Re: Yes/No popup box with Javascript

by "Comharsa" <comharsa(at)clara.net>

 Date:  Mon, 3 Apr 2000 22:57:09 +0100
 To:  "Rajnish Bhaskar" <9705228b(at)student.gla.ac.uk>,
<hwg-basics(at)mail.hwg.org>
 References:  localhost
  todo: View Thread, Original
> Does anybody know if it's possible to pop up a small "are you sure?"
> messagebox that will have a "yes" and "no" button on it?
>
> Thanks,
> Raj.

Yes, it is. The following would do it.

<input type="button" value="Submit" onclick="temp = window.confirm('Are you
sure?');">

The two options on the confirm dialogue wil be OK and Cancel. These return a
value of true or false to the variable "temp" in the example above, which
you could then use to decide whether something else happens..

HTH

Brian
comharsa(at)clara.net

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA