creating field validation

Discussion in 'JavaScript' started by bleustreak1, Apr 9, 2009.

  1. #1
    i am creating a form similar to http://www.centreforsight.com/default.aspx
    in php alongwith javascript i would like to create a field validator as in the page(when you click the submit button without entering the field you will see that an exclamation mark is shown on the right side of the field)

    now will this be done using only javascript or will php be also required.

    has anybody seen any similar code or any tutorial for this?

    Can somebody help me please?
     
    bleustreak1, Apr 9, 2009 IP
  2. fdoze

    fdoze Peon

    Messages:
    205
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  3. JavaScriptBank.com

    JavaScriptBank.com Peon

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    JavaScriptBank.com, Apr 9, 2009 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Just a tip: client-side only validation is almost the same as having no validation at all. Ie: if the user turns off javascript, normally the form will submit without problem, even though some or all of the fields are either empty or filled with invalid data.

    Therefore a server-side validation should also be used, to verify the input on the server before processing said input. Javascript validation is only useful for the user - not for the processing of data.
     
    PoPSiCLe, Apr 17, 2009 IP