jlivengood
15 years agoOccasional Contributor
Issue with Ajax Masked Extender Control
We have a date of birth box where we use an Ajax extender to help make sure the date is entered correctly. See the .aspx markup below..
<asp:TextBox ID="DOBTextBox" runat="server" Text='<%# Eval("DOB") %>' TabIndex="5"/>
<cc1:MaskedEditExtender ID="DOBMaskedEditExtender" runat="server"
ClearTextOnInvalid="true" Mask="99/99/9999" MaskType="Date"
TargetControlID="DOBTextBox">
</cc1:MaskedEditExtender>
When I run my scripts I see the date entered but when the text box control is clicked off of, (The user clicks the next text box in the form..) the text that has been entered goes away. Is there a way that anybody knows of to get the textbox to retain its value. Below is my code from the script. FindChildByName is simply a method I use to find the box. Any help or suggestions would be greatly appreciated.
Jason
<asp:TextBox ID="DOBTextBox" runat="server" Text='<%# Eval("DOB") %>' TabIndex="5"/>
<cc1:MaskedEditExtender ID="DOBMaskedEditExtender" runat="server"
ClearTextOnInvalid="true" Mask="99/99/9999" MaskType="Date"
TargetControlID="DOBTextBox">
</cc1:MaskedEditExtender>
When I run my scripts I see the date entered but when the text box control is clicked off of, (The user clicks the next text box in the form..) the text that has been entered goes away. Is there a way that anybody knows of to get the textbox to retain its value. Below is my code from the script. FindChildByName is simply a method I use to find the box. Any help or suggestions would be greatly appreciated.
Jason
var dobtext = FindChildByName('["Textbox"]("ctl00_ctl00_ctl00_BodyLoginView_BodyPlaceHolder_LoggedInBody_UploadBodyContext_AddLocatePatientCtrl_AddLocatePatientInfo_EditFormView_DOBTextBox")') ;
dobtext["SetText"]("03031975");