Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i click submit button in a webpage,i have kept a confirm box having ok and cancel buttons when i click ok button it should redirect to webpage(home.aspx) and when i click cancel button it should redirect to (index.aspx)..how to code for it..help me please....thanks in advance
Posted
Updated 1-Jan-13 4:34am
v2

1 solution

You can handle this directly in the Javascript confirmation dialog.

Here is an example -
if (confirm('Message')) {
    window.location = "ConfirmPage.aspx";
}
 
Share this answer
 
Comments
Espen Harlinn 1-Jan-13 11:08am    
5'ed!
Abhinav S 1-Jan-13 11:19am    
Thank you Espen.
nityasri 1-Jan-13 11:46am    
i tried the above code if (confirm('Message')) {
window.location = "ConfirmPage.aspx";
}
but its not working may be i am missing some namespace i think..what namespace should we use here.sir
Abhinav S 1-Jan-13 11:59am    
You need the path to the file.
nityasri 1-Jan-13 12:51pm    
alright sir thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900