06 Feb 2014

Javascript, form reset and hidden fields

Quick heads up, form reset doesn’t clear values of hidden fields. To properly clear form fields and hidden inputs, you can do this in JQuery:

1
2
$("#form")[0].reset();
$("input[type=hidden]").val('');

 

Looking for a simple marketing automation tool to automate your customer onboarding, retention and lifecycle emails? Check out Engage and signup for free.

 

My name is Opeyemi Obembe. I build things for web and mobile and write about my experiments. Follow me on Twitter–@kehers.

 

Next post: Tinypress update