I think this is a really quick question - and would appreciate any help...


I have the following simple form vaidation script on a [classic] ASP page:


Code VB:
<script>
	function validateForm(frm)
		{
		if(frm.subject.value=="")
		{
		alert('You must provide a subject.');
		frm.subject.focus;
		return false;
		}
		if(frm.message.value=="")
		{
		alert('You must provide a message.');
		frm.message.focus;
		return false;
		}
	frm.submit();
	}
</script>

---------------------------------------
I want to add one more validation
at the beginning of the script,
just to slow down spam bots:


For the following input field:

Code HTML4Strict:
<input type="text" name="foo" style="display: none;">

The validation should:

if [foo] equals "" contunue to the rest of the validation
else
if [foo] doesn't = "" redirect to [http://foo.com/page.asp]



Getting the script syntax right is driving me nuts -
can you help?

Thanks,

- Michael
(obviously not a coder)

http://www.sitepoint.com/easy-spam-prevention-using-hidden-form-fields/