EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on May 22, 2014, 10:56:01 PM



Title: extending form.reset() [Solved]
Post by: devnull on May 22, 2014, 10:56:01 PM
How can I extend form.reset() so that it does not clear any inputs where the hasClassname = 'persist' ?



Title: Re: extending form.reset()
Post by: stworthy on May 22, 2014, 11:47:55 PM
To extend your own reset method, follow the code below:
Code:
$.extend($.fn.form.methods, {
reset2:function(jq){
return jq.each(function(){
var f = $(this);  // the form
// reset your input here
});
}
})

Once you extended this method, you can call it like this:
Code:
$('#ff').form('reset2');