Skip to content Skip to sidebar Skip to footer

Create A Popup With Radio Box Using Js

First of all, I'm just a rookie with few knowledge on java script I wanna create a pop up with three radio button on it, let's say, A, B, and C How can I make it, can anybody help

Solution 1:

include jQuery and jQuery UI in your application( will make this much easier).

In your HTML page HEAD section say:

<script>
    $(function() {
        $( "#dialog" ).dialog();
    });
    </script>

In your HTML BODY say:

<div id="dialog" title="Radio Dialog">
    <inputtype='radio' value='A' name='myRadio'>A
    <inputtype='radio' value='B' name='myRadio'>B
    <inputtype='radio' value='C' name='myRadio'>C
</div>

Solution 2:

You cannot use the native JS alert or confirm methods to include radio buttons, they are for text purposes only. If you want custom pop-ups, use either something like jQuery UI (as Joshua mentioned above), or better, just craft it yourself. Make a `div' with radio-buttons inside, add appropriate CSS to design it, then keep it in the HTML limbo without attaching it. Bind the attachment to your event of choice.

Post a Comment for "Create A Popup With Radio Box Using Js"