Apr 29, 2009, 6:09 AM
Can't read value from disabled textfield
Hi!
I have a disabled textfield that I set its value via javascript with the setRawValue() method. When I do postback I try to read its value server side with textfield.Text or textField.Value and they are allways empty. If I enable the textfield it works fine.
I have a disabled textfield that I set its value via javascript with the setRawValue() method. When I do postback I try to read its value server side with textfield.Text or textField.Value and they are allways empty. If I enable the textfield it works fine.
JS:
txtBeginTime.setDisabled(true);
var dt = new Date();
txtBeginTime.setRawValue(dt.format('hi'));
ASPX:
<ext:TextField ID="txtBeginTime" Width="150" runat="server" AllowBlank="false" MaxLength="4" AutoPostBack="true"
MaskRe="<%$ Resources:RegularExpressions, RegexTimeMask %>" Regex="<%$ Resources:RegularExpressions, RegexTime %>"
RegexText="<%$ Resources:RegularExpressions, RegexTimeErrorText %>">
</ext:TextField>
CS:
[...]
Time time = Time.Parse(txtBeginTime.Text.Trim()); //Text is allways empty
[...]
Regards.