Return to Snippet

Revision: 18563
at October 2, 2009 08:21 by Freebit


Initial Code
<script type="text/javascript">
    $(function() {
        // prepare second dialog
        $("#second_dialog").dialog({
            autoOpen: false,
            bgiframe: true,
            resizable: true,
            height:400,
            width: 800,
            modal: true,
            buttons:    {
                'Close': function(){
                    $(this).dialog('close');
                }
            }
        });
        // register click events
        $("#open_new_dialog").click(function(){
            $("#second_dialog").dialog('open');
        });
        $("#second_dialog_link").click(function(){
            alert("Second dialog link");
        });
        // register change events
        $("#selection").change(function(){
            alert($("#selection :selected").val());
        });
    }); 
</script>

<a id="open_new_dialog">
    Open Second Dialog
</a>

<div id="second_dialog">
    <a id="second_dialog_link">Click me</a>
    
    <select id="selection">
        <option value="0">first</option>
        <option value="1">second</option>
        <option value="2">third</option>
    </select>
</div>

Initial URL


Initial Description


Initial Title
JQuery generic dialog example part 2/2

Initial Tags
ajax, jquery

Initial Language
jQuery