Reset form using jQuery

One thing to be noted that pre-filled form values do not get reset using the html reset button. In this case, javascript becomes handy. It’s again even much easier to reset using JQuery. Here is the solution: function resetForm(id) { $(‘:input’,’#’+id) .not(‘:button, :submit, :reset, :hidden’) .val(”) .removeAttr(‘checked’) .removeAttr(‘selected’); } <input type=”button” onclick=”resetForm(‘formId’);” value=”Reset” /> Where …

Read moreReset form using jQuery

Hello world!

Dear All I am trying to share my knowledge gained so far in web development fields from now onwards via this blog. I will be sharing stuffs related to PHP/Mysql, Magento & more. Well nothing more to say, just stay tuned with my blog 🙂 Lastly, your suggestion/feedback is always valuable and will make my …

Read moreHello world!