开发者

javascript alert box with radio buttons

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. A开发者_如何学运维ny idea how to achieve this?


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.


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


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜