May 11, 200818 yr Hi, I am looking for a simple javascript validation script that will work on both IE and Firefox. All I really need to do is check if certain fields are empty (I'm not to fussed about correct email etc.) And I guess use an alertbox to inform the user My form looks like this: <form action="contact.php" method="post"> <p><label>*Name:</label> <input type="text" name="name" size="20" maxlength="40" /></p> <p><label>*Email:</label> <input type="text" name="email" size="20" maxlength="40" /></p> <p><label>Subject:</label> <input type="text" name="sub" size="20" maxlength="40" /></p> <p><label>*Message:</label><br/> <textarea cols="25" rows="10" name="body"></textarea></p> <p class="submit"> <input type="submit" name="submit" value="Send"/></p> <p><input type="hidden" name="submitted" value="TRUE"/></p> </form> It's ultimately only the name, email and message boxes that need to be validated. Any help would be much appreciated!
May 11, 200818 yr Hey scaz, I'd recommend the jQuery validation plugin if you want a quick and easy way to validate a form with Javascript. You could actually validate the entire form with only a few lines of Javascript with this method
Create an account or sign in to comment