February 21st, 2003, 04:50 PM
error checking a form
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??
February 22nd, 2003, 11:44 PM
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
February 23rd, 2003, 01:08 AM
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!