troubleshooting Question

Getting Jquery dialog to work

Avatar of cookers
cookers asked on
jQuery
5 Comments1 Solution313 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Jon Norman
Information Systems Manager
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros