Form Validation (Java)
Results 1 to 2 of 2

Thread: Form Validation (Java)

  1. #1
    Registered User PacMan's Avatar
    Join Date
    Apr 2001
    Posts
    262

    Form Validation (Java)

    I am very new to JAVA but have some experience in HTML. For learning experience, I simply want to validate a form. Would really appreciate your advice and your example. If possible, the script with comments so I know what is going on.


    Here is my form:
    <FORM METHOD="POST"
    ACTION="mailto:[email protected]"
    ENCTYPE="text/plain"
    onSubmit="return valid(this);">

    <strong>Your Email:</strong>
    <input type="text" name="email">
    <br>
    <strong>Date:</strong>
    <input type="text" name="date">
    <br>
    <strong>Time:</strong>
    <input type="text" name="time">
    <strong><br>
    <br>
    Please write the issue:</strong><br>
    <textarea name="problem" COLS="80" ROWS="10"></textarea>
    <br>
    <br>
    <INPUT TYPE="submit" VALUE="Submit">
    </FORM>


    The validation:
    - Email address = the email address has an "@" and a "." following the "@" sign.
    - Date = date is entered in the format 03/15/2007
    - Time = e.g. in the form 3:35 PM or 11:02 AM
    - Please write the issue = problem description is at least 2 characters long

    <SCRIPT> LANGUAGE="JavaScript"> I believe is a good start.. (help please).. Any example of a very simple script, with comments if possible. I checked the script on many sites, and I am still confused with the code. Thanks for any help..

  2. #2
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    here is an email validation code tutorial

    Best thing is to go through the code and post snippets that you don't understand
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

Similar Threads

  1. Form Mailer suggestion
    By Moostang in forum Programming And Web Design
    Replies: 7
    Last Post: September 9th, 2005, 03:28 PM
  2. Need Programming link.
    By Talonboy in forum Tech-To-Tech
    Replies: 4
    Last Post: September 9th, 2003, 01:07 PM
  3. java vm... argh!
    By goldmagnamon in forum Programming And Web Design
    Replies: 1
    Last Post: April 28th, 2003, 04:40 AM
  4. Best Java IDE
    By FooL in forum Programming And Web Design
    Replies: 4
    Last Post: November 27th, 2001, 06:35 PM
  5. java
    By houllier1982 in forum Windows 95/98/98SE/ME
    Replies: 6
    Last Post: July 16th, 2001, 11:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •