I'm trying to reset a form, but it doesn't clear out the previous selections. So when I refresh the page and submit it remembers the old values and submits them. Even if I haven't made any selections on the form. This is the code:
<script>
$(function(){
$("#eventForm")[0].reset();
});
</script>
Thanks
EDIT: The form
<form id="eventForm">
<select name="eventer" id="abc">
<option value="" disabled="disabled" selected="selected">Select Event</option>
<option value="USA">US</option>
<option value="UK">UK/option>
<option value="Fr">France</option>
</select>
<input type="submit" id="open" onclick="heading()" value="Start" />
<input type="button" id="close" onclick="closeAnalysis()" value="Stop"/>
I tried clearing them like this, but no success:
$(document).ready(
function(){
$("#close").click(
function(){
var values = [];
var selected = $("select").each(
function(){
values.push( $(this).val());
});
this.form.reset();
for (i=0;i<selected.length;i++)
$(selected[i]).val(values[i]);
});
}
);