Forum Moderators: open
I've tried changing several browser security settings (on IE in particular) but nothing seems to work. I haven't been able to figure out if this is a browser issue or if there is a way to work around this with any coding changes. Sessions seem overkill for a simple contact form. Any ideas?
While Javascript client-side validation saves the visitor time, you still have to validate it on the server side in case Javascript is disabled.
The best thing to do is have the "error" page be the form and populate the form with the submitted values. To do this you have a template of the form in your script. The perl-y equivalent would be:
print "content-type: text/html\n\n";
if ($error) {
print "you have the following errors in your form<br><ul>$error</ul>\n";
}
## $error is an <li>list of incomplete fields
print <<eoform;
<form>
<input type="text" name="fname" size="12" maxlength="30" value="$qs{'fname'}" />
......
</form>
eoform