JQuery UI Dialog... Metric Calculator

joshuajohnhutchison
joshuajohnhutchison used Ask the Experts™
on
I want to use a JQuery UI DIalog to pop up a metric conversion calculator.  Specifically I want to convert from cubic feet to cubic meters.  So... I created a test page that I have attached.

What I need to happen is the following:

1. When you open the dialog box and enter cubic feet in the text field, you see a cubic meter calculation show up in text, in the space under the text field.  example:  (CBM: ?????)

2. When you click OK, the new cubic meter figure is entered into the text field on the page.


I did as much as I could in the attached page.  If you could help me out with the rest, I would appreciate it.

   
test-dialog.html
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Please attach your complete code with UI library you are using in .zip format.

Author

Commented:
Dude, you can get it at jqueryui.com.  Its just the standard jquery library files.  The only other code I'm using is in the test file I attached.

Author

Commented:
I did some more work on this page.  I got the conversion script worked out in the dialog box and now the only problem is getting the cbm value from the dialog box into the textfiled on the page when the dialog box closes.  I attached the new updated test file.  I also started a new question since I haven't been getting a response to this one so... answer either or both and get 1000 points :)
test-dialog.html
Commented:
modify your code as follows

$("#dialog").dialog({
            bgiframe: true,
            autoOpen: false,
            height: 200,
            width: 490,
            modal: true,
            buttons: {
                Ok: function() {
                    $(this).dialog('close');
                    $("#cbm").val($("#cbm_text").text());
                }
            }
        });

Author

Commented:
Yeah dude, you got it bro.  Well done :)  Thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial