If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Server side form validation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-21-04, 13:02
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
Server side form validation

Hello,
I want to validate a form server side and I am looking for a bit of advice.
I have done it several times but only with a small amount of data, ie. an email address or a couple of fields and so far the way i have done it is than if the field is empty or the data isn't in the right format I redirect to the same page and add an error message in URL string to be then used on the page.

I now need to do it for a large form containing text area's etc and want to be able to save the data so the user doesn't have to reenter every thing for just a field missing.
I am guessing this is way too much to pass in the URL string and would like to know what other options are there (I am using ASP but would think the principals are the same for any languages).
I thought of saving the data to a table in the DB and reusing it then on a different page (at least in the case of an new insert), would I be on the right track?

Thanking you for any sugestion,
Regards,
Olivier
Reply With Quote
  #2 (permalink)  
Old 09-22-04, 19:26
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Well you could pass everything around in session variables....

So they submit... you populate the session variables for the fields they have entered. If you find a validation problem you populate and error message session variable, redirect back to the page. When you display your page you check for a session variable and populate using that then clear the variable so you are ready for the next submit.

Does that help at all?
Reply With Quote
  #3 (permalink)  
Old 09-23-04, 10:29
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
Hi there,
thank you for the session variable suggestion, is ther a limit to how much can be stored in a session variable?
Reply With Quote
  #4 (permalink)  
Old 09-23-04, 19:10
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
the only real limit is the size of the users session and the number of user sessions compared to the amount of available memory on the server...

you can store anything you want but if your sessions are too big or there are too many of them you may find your server starts to slow down and this may be a problem.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On