passing values to showmodal dialog

G

Guest

I have parent.aspx web page from which I call a modal dialog (child.aspx via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox id=txt_HN> on the child form with data from the caller.
for parent.aspx.....
<script> block
function UpdH(title,horse)
{
var iParms=new Object();
iParms.Name=horse;
....}
for child.aspx....
<script> block
I've tried "document.getElementById('txt_HN').value=iParms.Horse;" within child.aspx form - but get error "document.getElementbyId(...) is null or not an object". How do I do this?
 
R

Raymond Lewallen

David,

Try dialogArguments.window.document.getElementById.....

using the following to open your window in javascript:

var TestWindow = new Object();
TestWindow.caller = window.showModalDialog(URLstr, window, sFeatures);

replacing the parameters there with whatever you use as appropriate.

Raymond Lewallen


DavidS said:
I have parent.aspx web page from which I call a modal dialog (child.aspx
via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox
id=txt_HN> on the child form with data from the caller.
for parent.aspx.....
<script> block
function UpdH(title,horse)
{
var iParms=new Object();
iParms.Name=horse;
...}
for child.aspx....
<script> block
I've tried "document.getElementById('txt_HN').value=iParms.Horse;" within
child.aspx form - but get error "document.getElementbyId(...) is null or not
an object". How do I do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top