最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript alert box with radio buttons - Stack Overflow

programmeradmin0浏览0评论

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?

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?

Share Improve this question asked Mar 18, 2010 at 3:23 SyAuSyAu 1,6818 gold badges26 silver badges49 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 3

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)

  1. 暂无评论