basicavocado basicavocado - 7 months ago 8
HTML Question

small portion of my making my html website- I have a javascript section

I need help on a small javascript portion of my website assignment for class, filling in the blanks:
In the script section of your contact.html page, inside your document ready function but outside your submit function) add the following code to turn the dialog div (above) into a jQuery dialog box.

$(_______).dialog({
autoOpen: _____________,
modal: ________,
width: ________,
buttons: {
"_______": function() {
$(this).dialog("close");
} }
});


Note, this is just the code you are given in the demos for creating a dialog box. I have added several blanks to the code that you will need to set as follows:
The dialog function needs to be called for the element with the id of dialog.
It should not auto open
It should be modal
It should have a width set that is less than 600 pixels
The button name should be OK or Accept or something like that.

Answer

Although this not the right forum to ask these kind of questions, here is the answer for your question.

$("#DivIdWhichWillBecomeADialog").dialog({ 
    autoOpen: false, 
    modal: true, 
    width: 500px, 
    buttons: { 
        "OK": function() { 
                $(this).dialog("close"); 
              } 
    } 
});