Yes, that's the approach I suggested for you, twice, in the other forum. That's what you have to do, if you must perform your validation on the server.
If you read further back in the thread(s), you'll see that I also suggested a more efficient approach, which would result in less round-trips to the server.
That approach is to move your validation from the "server Save button", to a client script instead.
So the most efficient program flow would be:
1) User navigates to a page which contains:
a. the data-entry form.
b. a JavaScript Validation script to validate the form
c. a JavaScript "confirm" script
2) User fills out the form, clicks "Save".
3) The JavaScript validation occurs
4) Validation succeeds, submit the form to the server
5) Server commits data to the database
-or-
4) Validation fails
5) JavaScript confirm script runs
6) User confirms, submit the form to the server
7) Server commits data to the database
-or-
4) Validation fails
5) JavaScript confirm script runs
6) User cancels
In this approach, the program control goes from:
1) Server to Browser (display page)
2) Browser to Server (submit form)
In the other approach, program control goes from:
1) Server to Browser (display page)
2) Browser to Server (submit/validate form)
3) Server to Browser (register the confirm script)
4) Browser to Server (submit form again)
Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting