They may seem like a dumb question, but I am stumped. I With an html form, you input data and submit the data. Once submitted, my data goes to a database. That's fine, but when I go to use the form again, the same information I filled in the previous form, is in the input and select fields. I hate this because of convenience. I've figured out a way to reset "input" values when the page is refreshed with......
JAVASCRIPT
script>$(document).ready(function() {
document.getElementById('firstn').value= "";
document.getElementById('middlein').value= "";
document.getElementById('lastn').value= "";
document.getElementById('suffix').value= "";
document.getElementById("gradelevel").value = "";
});
</script>
but "gradelevel" the "select/option" above will not refresh like "firstn", "middlein" and so forth.
Here is the HTML
<input name="firstname" type="text" required="required" id="firstn" placeholder="First Name"/>
<input name="middleinitial" type="text" id="middlein" placeholder="M.I." onkeyup="moveCursor(this,'lastn')" size="2" maxlength="1"/>
<input name="lastname" type="text" id="lastn" placeholder="Last Name" />
<input name="suffix" type="text" id="suffix" placeholder="Suffix" size="4"/>
<select id="gradelevel" name="gradelevel">
<option value=""></option>
<option value="Freshman">College Freshman</option>
<option value="Sophomore">College Sophomore</option>
<option value="Junior">College Junior</option>
<option value="Senior">College Senior</option>
</select>
I've tried practically everything and I've even looked around on her for solutions but none solved my problem. Ideally, I want the form value to default to "" upon refreshing the page. If this is a "session" issue then I'm swinging far out of my league. JSFiddle