I am trying to use my limited JS skills to work on validating the form on the same page rather than having to reload like in PHP.
I wanted to have it validate on click and then perform the normal action of going to index.php but it looks like its bypassing the validation and just going to the new page. This is a problem because if the person doesnt fill out enough info it wont send the email to my account properly.
Here is what I have any ideas?:
HTML Code:
<form name="contactform" action="index.php" method="post">
Name <br /><input type="text" name="name" style="width:75%"><br />
Email (required if you want a response) <br /><input type="text" name="email" style="width:75%"> <br />
Subject <br /><input type="text" name="subject" style="width:75%"><br />
Message <br />
<textarea rows="15" cols="65" name="message"></textarea><br />
Validation<select name="notspam"><br />
<option value="invalid" selected="selected">Don't accept me I am a spam bot.</option>
<option value="valid">I am a human believe me!</option>
</select><br />
<input type="submit" name="send" value="Send!" onSubmit="return validate()">
</form>
EDIT: On a side note, you think having a dropdown box like that is good enough to stop spam?
|