954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Ajax Toolkit: MaskedEditExtender Question

So, I'm using ASP with a VB code behind. I have text boxes that are supposed to appear one by one only if the there is a location number in the preceding text box. I had that function working perfectly, but I needed to add a MaskedEditExtender in the place, well now upon exit the mask will not disappear. To make this more clear, I want the mask to appear when number is there and stored in the database that way.

This is part of the front end code

<asp:Label ID="label18" runat="server" Text="Number 2:"></asp:Label>
<asp:MaskedEditExtender  runat="server" ID="MaskedEditExtender1" AcceptAMPM="True" Mask="99-99-99-999-999" MaskType="number" ClearMaskOnLostFocus="false" TargetControlID="LocNum2">
                </asp:MaskedEditExtender>
<asp:TextBox ID="LocNum2"   MaxLength="16" AutoPostBack="true" class="txtboxwidth" runat="server"></asp:TextBox>
<asp:Label ID="label19" runat="server" Text="Number 3:"></asp:Label>
<asp:MaskedEditExtender  runat="server" ID="MaskedEditExtender2" AcceptAMPM="True" Mask="99-99-99-999-999" MaskType="number" TargetControlID="LocNum3">
                </asp:MaskedEditExtender>
<asp:TextBox ID="LocNum3"  MaxLength="16" AutoPostBack="true"  class="txtboxwidth" runat="server"></asp:TextBox>


Here is part of the back end code

If LocNum2.Text = "" Then
            MaskedEditExtender1.ClearMaskOnLostFocus = True
        End If
        If LocNum2.Text = "__-__-__-___-___" Then
            MaskedEditExtender1.ClearMaskOnLostFocus = True
        End If
        If LocNum2.Text <> "" Then
            MaskedEditExtender1.ClearMaskOnLostFocus = False
            label19.Visible = True
            LocNum3.Visible = True
        End If


I'm trying to fix the problem where the mask, "__-__-__-___-___" is not picked up by the if statement. By default with ClearMaskOnLostFocus is set to False. I'm a rather bit puzzled. Any suggestions would be great!

atrueresistance
Light Poster
30 posts since Aug 2010
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: