Element in Form

M

Mike

Hi,

I have a form with some dynamic controls. I then open a popup calendar and set the selected date back to the "parent" form using this statement:

string script = "<script>window.opener.document.getElementById('" + control.Value + "').innerText = '";
script += myCalendar.SelectedDate.ToString("dd/MM/yyyy") + "'";
script += ";self.close()" ;
script += "</script>";
RegisterClientScriptBlock("test", script);


The problem I am having is that when later accessing the control, the value of that control is still empty. But on the page, the new value is shown.

Does anyone have any idea on what could be wrong?

Thanks
Mike
 
J

John Saunders

InnerText doesn't get posted back to the server on postback. You need to set, for instance, the value attribute of an INPUT element. At any rate, you need to set something which will be sent back to the server.

--
John Saunders
johnwsaundersiii at hotmail


Hi,

I have a form with some dynamic controls. I then open a popup calendar and set the selected date back to the "parent" form using this statement:

string script = "<script>window.opener.document.getElementById('" + control.Value + "').innerText = '";
script += myCalendar.SelectedDate.ToString("dd/MM/yyyy") + "'";
script += ";self.close()" ;
script += "</script>";
RegisterClientScriptBlock("test", script);


The problem I am having is that when later accessing the control, the value of that control is still empty. But on the page, the new value is shown.

Does anyone have any idea on what could be wrong?

Thanks
Mike
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,138
Latest member
NevilleLam
Top