Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How can I make my form fields required?

  1. Oct 30, 2012 #1
    I am new to web design so forgive me if I come off as ignorant. Would some one direct me to a page or give me information on how to make my submit form fields required? Here is my current code:

    Code (Text):

    <form name="contact" action="process.php" method="post">
    <label>Name</label><br />
    <input type="text" name="name" /><br />
    <label>E-Mail</label><br />
    <input type="text" name="email" /><br />
    <label>Message</label><br />
    <textarea name="message" cols="50" rows="10"></textarea><br />
    <input type="submit" name="submit" value="Submit" />
    Any help would be valuable. Thanks!
  2. jcsd
  3. Oct 30, 2012 #2
  4. Oct 30, 2012 #3
    You can use some simple Javascript validation
    http://www.w3schools.com/js/js_form_validation.asp [Broken]
    Last edited: May 6, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook