Pass variables thru javascript code

Pass variables thru javascript code

  
Hello

I'd like to have anyone's help on this...

In my forms I have a button which opens a new modal-dialog-window, i.e., while this second window is opened, the user fills in some data and he cannot touch the main window. Then the user presses an OK button, the second window is closed and he comes back to the first window refreshing it automatically.
I open it thru a javascript code assigned to the button. I defined in Extended Properties of the button:
Name: onclick
Value: "window.showModalDialog('ReqAlterar2.aspx','','dialogWidth:400px;dialogHeight:300px');"

(RegAlterar2.aspx is an entry node defined to access the second window).

Now for the problem: How can I define the parameters to this "RegAlterar2.aspx" window? Should be something like
"window.showModalDialog('ReqAlterar2.aspx?param1=variable1&param2=variable2','','dialogWidth:400px;dialogHeight:300px');"
The problem is, "variable1" and "variable2" are variable contents inside main window and "param1" and "param2" are unkown names, like "in12345". How can I set them to pass thru this code?

Can anyone help me?

Thanks

Fernando Dias
Dear Fernando,

All your considerations in the previous post are correct. The javascript suggested will do what is required.

If I understood correctly, your only problem is identifying what the names of the parameters into the Entry node are for you to pass on the required information. Am I correct?

If this is indeed the case, these parameters' names are simply the input variable names of the screen the Entry points to. So, for example, if your screen has an IntegerIn and a TextIn parameter, you should simply compose the javascript to read

"window.showModalDialog('ReqAlterar2.aspx?IntegerIn=MyValue1&TextIn=MyValue2','','dialogWidth:400px;dialogHeight:300px');"

You do not have to refer to these input variables as "inXXXX".

Hope this helps.

Regards,


Miguel