Jump to content

confirmation popup window?


ssffcc

Recommended Posts

Have you gone through the tutorials yet? this should be a straightforward task

<html><head><script type="text/javascript">function disp_confirm(){var name=confirm("Press a button")  if (name==false)  {    var choice=confirm("Are you sure you want to cancel?")    if (choice==true)    {      alert("put cancel code here");    }    else{}  }  else  {  }}</script></head><body><form><input type="button" onclick="disp_confirm()" value="Confirm"></form></body></html>

Link to comment
Share on other sites

I dont quite understand "if (name==false)". what is it for?

for a confirm box: if you press ok it returns true, if you press cancel it returns falsewhat is name? Its the result of the confirm button, either true or falsename=confirm("Press a button")You then check its value in a control structure
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...