#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    15
    Rep Power
    0

    error checking a form


    i'm making a forum, and previously i was submitting the form to an asp file, which would check for errors -- if there were errors, it would redirect back to the form with error messages to be displayed -- if it was error free, the message would be written to a txt file. but then i wanted to put in a preview message page, and so error checking and passing values between the three pages is becoming tricky. so i'm at the point where i'm starting to use javascript to error-check, which works fine for making sure the input is good, but i don't know a good way to notify the user that there are errors with javascript. alert messages are unprofessional, and i can't just add text to the page using javascript.

    i'd prefer to use only asp, and i'd prefer it if i didn't have to use an extra asp page JUST to error-check. as it is now i have these pages involved in adding a new subject:

    post subject (has the form for the subject and message; the user can click either post message, which will directly write the message, or preview message, which will bring them to a page which displays the post as it would appear once written)

    preview message (regardless of what the user clicks, it would come here first to do error checking, and depending on what the user clicked it would either redirect to the page which writes the subject, or display the message; the problem is, if there are errors with the form, i need to point the user back to post subject without losing whatever info they have already entered. the only way i know how to do that is by submitting a form [i can't use a querystring because it won't maintain the message if the user entered multiple lines in the message])

    add subject (this does the backend writing of the message, and is only accessed if the fields have made it through the error-checking)

    any solutions in mind on how to pass the field values between these three pages?? or is there a better way i can do error checking??
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12

    just an idea


    Use only two pages ... combine the Main entry and the preview in one page.

    Similar to posting new threads and replys on this site!!

    When you click preview, the exact same page reloads with an area at the begining to show the preview.


    I hope I am making any sense here
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    15
    Rep Power
    0
    i thought about trying that, but when i looked closer at the code, all i had to do was add an else statement (where i previously had none, so even when the if statement was processed, so was everything else, which was hanging up the page). with the else statement, the rest of the code gets skipped at the problem is solved. thanks anyway!

IMN logo majestic logo threadwatch logo seochat tools logo