Required fields in email forms

Discussion in 'HTML & Website Design' started by MaryMach, Jul 17, 2012.

  1. #1
    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>
     
    Solved! View solution.
    MaryMach, Jul 17, 2012 IP
  2. #2
    workingsmart, Jul 17, 2012 IP