G
Guest
How do I read the value of an html input control from inside a javascript
user control?
An aspx page contains a user control that attempts to read a value from an
html input control in the aspx page.
For example:
In the aspx page, the control is defined as:
<input id="txtTMOStart" runat="server" name="txtTMOStart" type="TEXT"
size="30" value="test" enableviewstate="true" />
The Javascript user control attempts to read the value from the control:
var controlValue = document.aspnetForm.txtTMOStart.value;
However, controlValue is always null even thought the control is initialized
with a value.
Note:
If the runat="server" attribute is removed from the html control, the value
returned is not null, however, I can't read the control’s value from the code
behind file!
Any ideas?
Thanks.
user control?
An aspx page contains a user control that attempts to read a value from an
html input control in the aspx page.
For example:
In the aspx page, the control is defined as:
<input id="txtTMOStart" runat="server" name="txtTMOStart" type="TEXT"
size="30" value="test" enableviewstate="true" />
The Javascript user control attempts to read the value from the control:
var controlValue = document.aspnetForm.txtTMOStart.value;
However, controlValue is always null even thought the control is initialized
with a value.
Note:
If the runat="server" attribute is removed from the html control, the value
returned is not null, however, I can't read the control’s value from the code
behind file!
Any ideas?
Thanks.