#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Canada
    Posts
    185
    Rep Power
    0

    same form wrong values


    when a user submits a wrong value for a field is there a way to return the form with the given values but with a red asterix indicating where the error was and their previous values still filled in.

    I would like to do that instead of having to make them go back a page. Is this only possible in javascript or somthing?
    "In theory, there is no difference between theory and practice.
    But, in practice, there is."

  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    Client side - use Javascript to validate the form before it is submitted to the server.

    Server side - after the form is submitted check for errors. If there are errors, redisplay the form with the fields highlighted.

    This will require your form to accept data - to pre-load the fields with values. Part of the the data supplied to the form could be a list of fields identified with errors. Your form display code can then choose to highlight the fields.

    Grim
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Canada
    Posts
    185
    Rep Power
    0
    thanks grim. is this only done in javascript or can it be done easily in python?
    "In theory, there is no difference between theory and practice.
    But, in practice, there is."

  6. #4
  7. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    Client side - stick to javascript. at least you know the client has it installed.

    Python client scripting did work once (for IE anyway) but not anymore

    Grim
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    Originally Posted by caroundw5h
    thanks grim. is this only done in javascript or can it be done easily in python?
    you can do the whole thing with Python.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Canada
    Posts
    185
    Rep Power
    0
    Originally Posted by jimmy2k1
    you can do the whole thing with Python.
    really??? can you let me know o howi would go about doingthis?
    "In theory, there is no difference between theory and practice.
    But, in practice, there is."


IMN logo majestic logo threadwatch logo seochat tools logo