You are suggesting using it for form validation. That makes since, but do you worry about
people that don't have it turned on? How do you handle that? If someone doesn't have
javascript on, are they just out of luck? In that case have you lost out on someones buisness (or
has whom ever hired you lost out on someones buisness?) I understand on high traffic sites it is
probably a good thing, but what about a backup plan for the people that don't have it on?
by the way, there are cars designed for people that like to drive with bald tires, you can usually find them
at the local drag strip :~) update: corrected spelling
Stuffy
That's my story, and I'm sticking to it, unless I'm wrong in which case I will probably change it ;~)
This can be solved by checking if the user has javascript enabled, if not, pass a hidden flag then have the cgi script do it. You could so something like this.
HTML Form
<form>
<noscript>
<input type="hidden" name="jsenabled" value="yes">
</noscript>
</form>
CGI Script
if ($q->param('jsenabled') eq "Yes") {
#perform validation
}
You're trusting that input is from your form, and that your form has gone unedited. Clientside .*script is helpful, but is no substitute for good practice.