Forum Moderators: open

Message Too Old, No Replies

Redirection Question

need to ignore server side code

         

Sangarius

4:41 pm on May 19, 2004 (gmt 0)

10+ Year Member



Hello,

I have a question that I cannot seem to find any information on.

I am coding in ASP and JavaScript. I pass the form information to another page where I do some validation by comparing the form text fields with database records thorough ASP. If certain conditions fail I need to display a warning(confirm) box, to make the user aware. If the user clicks "ok" then I want the rest of the page code to execute. However if the user clicks "cancel" then I want redirection to the previous page without the rest of the ASP code executing.

Does anyone know if this is possible? Or does the JavaScript only execute after the ASP (server side) has been run. Any suggestions on how I could do this would be much appreciated.

Thanks,
Sangarius

DrDoc

4:56 pm on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, the JavaScript only executes after the entire page has been processed and sent to the browser...
Besides, what if the visitor has JavaScript turned off? It's better (and easier) to provide a simple confirmation page with the OK and Cancel buttons...

Sangarius

4:59 pm on May 19, 2004 (gmt 0)

10+ Year Member



Thank you DrDoc,

Just to clarify, do you mean a seperate ASP page with an ok or cancel button with the appropriate redirection?

Sangarius

DrDoc

5:28 pm on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, separate page...