I get an error message from my jquery dialog:
Error: Expected identifier, string or number.
The error message points to the line with the buttons: { declaration. Any know what could cause the problem?
$(document).ready(function(){
var $dialog = $('<div></div>').html('<form id="myform" action=""><input type="checkbox" id="completeCheck" name="completeCheck" value="" />Completeness check<br /><input type="checkbox" name="viewUnofficial" value="Car" /> View unofficial status <br /><input type="checkbox" name="consist" value="" />Consistency<br /><input type="checkbox" name="otherData" value="" />Other checks<br /><input type="checkbox" name="keyCheck" value="" />Key check<br /><input type="checkbox" name="compareVersions" value="" />Compare versions<br /></form>').dialog({
autoOpen: false,
title: 'Select data check',
buttons: {
"Submit Form": function () {
$('form#myform').submit();
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
});
Working demo of your code http://jsfiddle.net/ta7QY/
Feel free to play around with the demo;
$('div')and I have also instantiated the dialog on click of a link. rest code as per below.This will help,
:)code
Script