tags:

views:

242

answers:

4

I want to create an alert box with 3 radio buttons in it. It should be like

'Replace' 'Save' 'Merge'

along with OK and Cancel buttons. Any idea how to achieve this?

+2  A: 

There is no default javascript box that does this, you have confirm(), prompt and alert available and that's it.

There are however widgetsets/libraries that give you this option. Try Ext JS for example

WoLpH
A: 

use the input tag to generate radio buttons

<input type="radio" name="button_1">Replace</input>

and div tag to generate you okay and cancel buttons

<div id="cancel">Cancel</div>

and have the onclick functions of your div's be a javascript call which pulls the data out of the radio buttons.

Mimisbrunnr
+2  A: 

To add to what WoLpH said, you specifically want a modal overlay that can be called programmatically similar to an alert box. Give jQuery UI or YUI a try.

Tilo Mitra
A: 

You can use javascript to create modal dialog box with the controls you would like to show. You can customize the look & get rid of the default grey dialog boxes, it's really cool. Check the link below.

Javascript modal dialog sample

SoftwareGeek