I would like some help in getting Jquery Dialog working. So far I have used Jquery tutorials to get going but have reached a bit of a cul de sac. I am trying to fire a JQ dialog from a javascript and not from a click. The dialog fires OK but im at a loss trying to catch its returns. So I have the following.
In the document ready script
jQuery('#remove_dialog').dialog({
autoOpen: false,
width: 400,
modal: true,
resizable: false,
buttons: {
"OK": function() {
jQuery(this).dialog("close");
return true
},
"Cancel": function() {
jQuery(this).dialog("close");
return false
}
}
});
and a div with the dialogue
<div id="remove_dialog" title="Confirm Action ">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 0 0;"></span> You clicked to remove car:</p>
<p id="dialog-rego"></p>
<p>Click "OK" to remove.</p>
<p>If not, click Cancel.<p>
</div>
and the function which fires the dialog
function remove(){
var iFrame = document.getElementById('formsframe')
OForm=iFrame.contentDocument.getElementsByTagName('form')[0]
carreg = OForm.registration.value;
document.getElementById('dialog-rego').innerHTML=carreg
return jQuery('#remove_dialog').dialog('open');
reggo=loadTextDoc("POST","php/remove.php?q="+carreg,false);
warning(carreg+ " has been removed from the database");
return false;
}
So..how do I catch and interpret the returns from the dialog, control doesnt appear to pass back to the remove function.
Thanks for any help
Open in new window
I have left the return false at the bottom of your script, I don't know what you want to return from remove();