I have a page with several check-boxes in a form, which when selected, filter corresponding info out of a table with jquery. My problem is the following scenario:
Do not allow your page to be cached, or add code to reset your form:
$("form input").each(function(){
var elem = $(this);
var type = elem.attr("type");
if(type == "checkbox") elem.prop("checked", "");
else if(type == "text") elem.val("");
});
.each has to be used, because the CSS selector input[type=text] doesn't match , while the element is still a text element.