Using the dialog box

Using the dialog box

Hello,

I have looked at all your examples on how to use the dialog box but I still have a problem.

I am calling the dialog to open a from, this form needs to get parameters from the page that opens it and send them back to the page after submitting the form to the database.

The problem I am having is that the dialog box is being called on document.ready and the fiels on the page are not filled in yet, so: document.getElementById is actually empty.

To make things a bit more clear:

I have a form with a button, when I click the button I want to open a form in a dialog box that submits fields to a database. The submit page redirects to the first form and the first form needs to have the values that were already selected there.

So in the document.ready function I am doing something like:

var x = document.getElementById('y').value;

but because it is being called on document.ready, the value is empty.

Hope you can understand my problem.

Is there a way to call the whole thing on button click and not on document.ready?

Thank you,

Sigal