Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multiple RegularExpressionValidator and ValidatorCalloutExtender

Posted on 2008-10-14
1
Medium Priority
?
1,330 Views
Last Modified: 2012-05-05
So i have a page where the user selects a name from a drop down and this populates a text box with the users email address , there are also values that are free form to where the user can enter in there own email address. So to help with validation i put a regular expresssion validator and a call out extender to let the user know if they typed in the email address  incorrectly. So this works fine and if the user clicks submit it correctly pops up a message over the incorrect text box. So if there are more than one text box with an issue can i have multple extenders show? what also seems to happen is that only the first text shows up as an error when i click submit so i fix that one, any subsequent boxes will not display an error but the page will not submit.

here is what i have for aspx code
<table>
                    <tr>
                        <td><asp:Label runat="server" ID="lblContactType" >Contact Type</asp:Label></td>
                        <td><asp:Label runat="server" ID="lblName" >Name</asp:Label></td>
                        <td><asp:Label runat="server" ID="Label30" >E-mail Address</asp:Label>
                       
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="Label31" >Business Driver:</asp:Label></td>
                        <td><sb:DropDownList runat="server" ID="BusinessDriver"  Enabled="false" >
                        </sb:DropDownList></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbBusinessDriverEmail" Width="350px" MaxLength="50" Enabled="false"></sb:TextBox>
                            <asp:RegularExpressionValidator ID="rvBusinessEmail" runat="server"  ControlToValidate="sbBusinessDriverEmail"  EnableClientScript="true" SetFocusOnError="true"  
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="veBusinessEmail" TargetControlID="rvBusinessEmail"  Width="250px"  
                            HighlightCssClass="highlight" />
                           
                            </td>
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="Label32" >Impact Analysis:</asp:Label></td>
                        <td><sb:DropDownList runat="server" ID="ImpactAnalysis" Enabled="false"></sb:DropDownList></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbImpactAnalysisEmail" Width="350px"  MaxLength="50" Enabled="false"></sb:TextBox>
                         <asp:RegularExpressionValidator ID="REAnalysisEmail" runat="server"  ControlToValidate="sbImpactAnalysisEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VEImpactEmail" TargetControlID="REAnalysisEmail" Width="250px"
                            HighlightCssClass="highlight" />    
                        </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label33" >BSC:</asp:Label></td>
                        <td><sb:DropDownList runat="server" ID="BSC" Enabled="false"></sb:DropDownList></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbBSCEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                             <asp:RegularExpressionValidator ID="REBSC" runat="server"  ControlToValidate="sbBSCEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VEBSC" TargetControlID="REBSC" Width="250px"
                            HighlightCssClass="highlight" />
                            </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label34" >UAT Analyst:</asp:Label></td>
                        <td><sb:DropDownList runat="server" ID="UATAnalyst" Enabled="false"></sb:DropDownList></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbUATAnalystEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                             <asp:RegularExpressionValidator ID="REUAT" runat="server"  ControlToValidate="sbUATAnalystEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VEUAT" TargetControlID="REUAT" Width="250px"
                            HighlightCssClass="highlight" />
                            </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label36" >CSSO PM:</asp:Label></td>
                        <td><sb:DropDownList runat="server" ID="CSSOPM" Enabled="false"></sb:DropDownList></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbCSSOPMEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                          <asp:RegularExpressionValidator ID="RECSSO" runat="server"  ControlToValidate="sbCSSOPMEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VECSSO" TargetControlID="RECSSO" Width="250px"
                            HighlightCssClass="highlight" />  
                            </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label39" >TIG PM:</asp:Label></td>
                        <td><sb:TextBox runat="server" ID ="sbTIGPMName" Enabled="false"></sb:TextBox></td>
                        <td>
                        <sb:TextBox runat="server" ID ="sbTIGPMNEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                         <asp:RegularExpressionValidator ID="RETIGPM" runat="server"  ControlToValidate="sbTIGPMNEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VETIGPM" TargetControlID="RETIGPM" Width="250px"
                            HighlightCssClass="highlight" />
                        </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label40" >PI&C:</asp:Label></td>
                        <td><sb:TextBox runat="server" ID ="sbPLCName" Enabled="false"></sb:TextBox></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbPLCEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                             <asp:RegularExpressionValidator ID="REPLC" runat="server"  ControlToValidate="sbPLCEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VEPLC" TargetControlID="REPLC" Width="250px"
                            HighlightCssClass="highlight" />
                            </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label41" >L&D:</asp:Label></td>
                        <td><sb:TextBox runat="server" ID ="sbLDName" Enabled="false"></sb:TextBox></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbLDEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                             <asp:RegularExpressionValidator ID="rvLDEmail" runat="server"  ControlToValidate="sbLDEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender
                            runat="Server"
                            ID="ValidatorCalloutExtender8"
                            TargetControlID="rvLDEmail"
                            Width="250px"
                            HighlightCssClass="highlight"
                            />
                            </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label42" >Sales Team Lead: </asp:Label></td>
                        <td><sb:TextBox runat="server" ID ="sbSalesTeamLeadName" Enabled="false"></sb:TextBox></td>
                        <td>
                            <sb:TextBox runat="server" ID ="sbSalesTeamLeadEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                             <asp:RegularExpressionValidator ID="RESalesTeam" runat="server"  ControlToValidate="sbSalesTeamLeadEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format  yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VESalesTeam" TargetControlID="RESalesTeam" Width="250px"
                            HighlightCssClass="highlight" />
                            </td>
                    </tr>
                     <tr>
                        <td><asp:Label runat="server" ID="Label43" >Service Team Lead: </asp:Label></td>
                        <td><sb:TextBox runat="server" ID ="sbServiceTeamLeadName" Enabled="false"></sb:TextBox></td>
                        <td>
                        <sb:TextBox runat="server" ID ="sbServiceTeamLeadEmail" Width="350px" Enabled="false" MaxLength="50"></sb:TextBox>
                         <asp:RegularExpressionValidator ID="REServiceEmail" runat="server"  ControlToValidate="sbServiceTeamLeadEmail"
                        Display="None"  ValidationExpression="^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$"
                        ErrorMessage="Email must be in valid format yourname@COMPANYNAME.com"/>
                        <ajax:ValidatorCalloutExtender runat="Server" ID="VEServiceEmail" TargetControlID="REServiceEmail" Width="250px"
                            HighlightCssClass="highlight" />
                        </td>
                    </tr>
 
                </table>
            </fieldset>
0
Comment
Question by:Steege
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Steege earned 0 total points
ID: 22723536
all i had to do was SetFocusOnError="true" on all the reg  expression validators and it work
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question