I’m currently working on my first form (for sending email to the site). It’s working fine (code below), however I would like to make two of the fields (email and disclaimer) ‘required’. Can someone please tell me how to do that? <form action="http://www.justhost.com/justmail" enctype="multipart/form-data" method="POST"> Name: <input type="text" name="Name" /><br /> Email (required): <input type="text" name="Mailfrom" /><br /> <input type="hidden" name="Subject" value="Email from WebForm" /> City: <input type="text" name="City" /><br /> State: <input type="text" name="State" /><br /> Zip: <input type="text" name="Zip" /><br /> Phone: <input type="text" name="Phone" /><br /> How would you like to be contacted (check all that apply): <input type="checkbox" name="Contact 1" value="Contact by email" /> Email<br /> <input type="checkbox" name="Contact 2" value="Contact by phone" /> Phone<br /> How can we help you? Brief description of your legal issue:<br /> <textarea name="Message" rows="10" cols="30"></textarea><br /> The use of the Internet or this form for communication with the firm or any individual member of the firm does not establish an attorney-client relationship. Confidential or time-sensitive information should not be sent through this form. <input type="checkbox" name="Disclaimer" value="I have read the disclaimer." /> I have read the disclaimer. (required) <input type="hidden" name="sendtoemail" value="mary@marymcmullen.com"><br> <input type="hidden" name="redirect" value="http://www.marymcmullen.com/index.html" /> <input type="submit" value="Send Email" /> </form>
Here are 2 simple JavaScript solutions.... http://www.netmechanic.com/news/vol6/javascript_no4.htm http://www.w3schools.com/js/js_form_validation.asp Since you are learning, best to use the guides there to give you an idea for now and the future. Good Luck!