Link to home
Start Free TrialLog in
Avatar of Shade22
Shade22Flag for United States of America

asked on

Ajax Mask and Compare Validator

I have an SSN field that I need masked and then validated using Ajax.  I currently have it working on only one site(which is built on the 4.0 .net frameset) but 3 other sites(4.5 frameset) that do not work.  They are all using the exact same coding but only the 4.0 frameset works.

  <tr align="center">
    <td><asp:Label ID="lb_regSSN" runat="server" Text="Social Security#:" CssClass="form_label"></asp:Label></td>
    <td><asp:Label ID="lb_vrfRegSSN" runat="server" Text="Verify Social Security#:" CssClass="form_label"></asp:Label></td>
  </tr>
    <tr align="center">
      <td>
 <asp:TextBox ID="tb_RegSSN" runat="server" CssClass="inputs" ValidationGroup="vg_NewUser"></asp:TextBox>
       </td>
      <td>
<asp:TextBox ID="tb_VerSSN" runat="server" CssClass="inputs" ValidationGroup="vg_NewUser"></asp:TextBox>
      </td>
       </tr>
         <tr align="center">
       <td>
<asp:RequiredFieldValidator ID="rfv_RegSSN" runat="server" ControlToValidate="tb_RegSSN" ErrorMessage="Please enter your SSN#." Display="Dynamic" ForeColor="Red" Font-Size="Small" ValidationGroup="vg_NewUser"></asp:RequiredFieldValidator>
 </td>
   <td>
<asp:RequiredFieldValidator ID="rfv_VerSSN" runat="server" ControlToValidate="tb_VerSSN" ErrorMessage="Please re-enter your SSN#." Display="Dynamic" ForeColor="Red" Font-Size="Small" ValidationGroup="vg_NewUser"></asp:RequiredFieldValidator>
 </td>
 </tr>
  <tr align="center">
 <td colspan="2">
<asp:MaskedEditExtender ID="mee_SSN" runat="server" Mask="999-99-9999" MaskType="Number" Filtered="-" MessageValidatorTip="true" InputDirection="LeftToRight" AutoComplete="false" ClearMaskOnLostFocus="false" TargetControlID="tb_RegSSN"></asp:MaskedEditExtender>

<asp:MaskedEditExtender ID="mee_SSN2" runat="server" Mask="999-99-9999" MaskType="Number" Filtered="-" MessageValidatorTip="true" InputDirection="LeftToRight" AutoComplete="false" ClearMaskOnLostFocus="false" TargetControlID="tb_VerSSN"></asp:MaskedEditExtender>
                                                         <asp:CompareValidator ID="cv_SSN" runat="server" ControlToValidate="tb_VerSSN" ControlToCompare="tb_RegSSN" Type="String" ErrorMessage="Social security numbers do not match." ForeColor="Red" Font-Size="Small" Display="Dynamic" CssClass="pull-right" ValidationGroup="vg_NewUser" ></asp:CompareValidator>
                                                          </td>
                                                 </tr>

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What version of the AJAX Control Toolkit are you using?  I believe that the current version is v15.1.2.
Avatar of Shade22

ASKER

Yes. I am using the v15.1.2 version.
Hmmm...is the framework version the only difference between the 4.0 and 4.5 projects?

Are you getting any errors, or does it just not do anything?
Avatar of Shade22

ASKER

Yes.  The code is exactly the same, down to the ID of the object.  It will constantly say that the two items do not match when they do match.  Like I said, this code was taken from a working environment in the 4.0 framework.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shade22

ASKER

Thanks for the help Bob, but this was a weird case where nothing worked so I had to do it with javascript.