Question

With alerts you can have text inputs. I was hoping you could put check boxes in. Is this possible?

http://www.w3schools.com/JS/js_popup.asp

Was it helpful?

Solution

No, you would need to build out a dialog box in order to achieve this.

You are able to achieve this with relative ease through jQuery and more specifically the jQuery UI plugin, allowing dialog boxes to come up without too much know-how

OTHER TIPS

No. The only options are:

  • alert (display string);
  • confirm (display string and get yes/no|true/false back);
  • prompt (display string and get input string back)

You can create your own modal dialog using a variety of techniques. Under the hood, they all essentially do the same thing - display a separate web page in a popup window or iFrame and disable input access to the rest of the browser until the popup is closed. These are pretty easy to get wrong (hard to use + very annoying) but when done right they offer the developer a lot of power - since it's a complete web page you control, you can pass complex JavaScript objects between the dialog and the main browser window, instead of having to rely on the primitive interaction modes offered by the out-of-the-box dialogs.

Pretty shure it isn't possible. However, you can simulate a "alert box" with the contents you need. JQuery, for example, is a great javascript framework to achieve that.

no, but you can create a function that opens a alert box with html in it, like on facebook.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top