Returning A Validation Error

Discussion in 'PHP' started by oo7ml, Jun 20, 2012.

  1. #1
    Hi, i am in the middle of coding some server side validation for a Create Account form for my website.

    I am trying to decide what the best and most elaborate way is to the return server side validation errors. I currently have a "slick" interface working with jQuery and Ajax BUT i want to be able to return the errors in a "slick" way IF my user decides to turn JS off.

    The options i have seen are:

    - return all the errors in red on a new page, with a back button
    - return the errors in red at the top of the Create Account page
    - return the errors at for each field in red directly above each filed

    01 - what other options are there out here
    02 - what option would you suggest

    Thanks in advance for your help...
     
    oo7ml, Jun 20, 2012 IP
  2. Oli3L

    Oli3L Active Member

    Messages:
    207
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    70
    #2
    I'm pretty lazy, so i would probably choose the first or the second option.
    if you have time and are not too lazy, you can make the third option, it's very good, and as a cliet who just signs up, it'd be the best in order to continue creating an account
     
    Oli3L, Jun 20, 2012 IP
  3. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Ok cool, thanks...
     
    oo7ml, Jun 20, 2012 IP
  4. freelanceinphp

    freelanceinphp Member

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #4
    I think, you need to implement option 2 and 3 both to display your validation. it helps when you have large forms and their elements. For small forms, option 2 is fine.
     
    freelanceinphp, Jun 20, 2012 IP
  5. prabhunimish

    prabhunimish Member

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    46
    #5
    Since you are trying to decide "best and most elaborate" way, I would suggest you to go with the third option!

    Personally, I find the third option as the best option as well.
     
    prabhunimish, Jun 21, 2012 IP
  6. davidson_11

    davidson_11 Active Member

    Messages:
    33
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    80
    #6
    I believe the users without JS will be rare, and I advise you not to work too hard on styling the validation. All your options should be fine, however I recommend 2 and 3.
     
    davidson_11, Jun 22, 2012 IP