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?
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.