<?php
$formdata = "formdata";
echo "<form><input type=text value=".$formdata.">
<input type=reset></form>";
?>
I wanted to prefill ALL elements of my forms, not just textboxes, so I used javascript for dropdown menus and checkboxes. I figured PHP would be an easier and quicker way to go for textboxes, since they are the most frequently used types on my forms.
However, I noticed when I clear the form, using either a reset button as shown above, or a button with the javascript to reset (same thing), the prefilled textboxes do not reset. On one hand, this creates kind of a cool "cancel changes and revert to saved data" feature, but since drop down menus and checkboxes still clear, that's not really what I need.
I bet the reason is because the "reset" function clears anything a user has typed in, and since the data is already stored, nothing has been typed. So is there a ways to go about this with PHP, or should I look for a javascript function that completely erases the form?
Thanks!