Search code examples
jquerycssjquery-ui-dialog

Using ui dialog buttons


I have dialogs on my pages which apply the ui dialog button set, i use this code

$('#pop_div').load("mypopname.php").dialog({
        width: 880,
        height: 650,
        modal: true,
        draggable: false,
        resizable: false,
        title: 'page title',
        buttons: {
            Cancel: function () {
                $('#pop_div').dialog("close");
            },
            Submit: function () {
                $("#frmname").submit();
            }
        }
    });

I was wondering is it possible to use the same buttons (theme) normally in any page (not necessarily in a dialog) ??


Solution

  • HTML:

    <button>A button</button>
    <input type="submit" value="A submit button" />
    

    JavaScript:

    $('button').button();
    $('input[type=submit]').button();