LauraCairns
Programmer
I have the following textbox in the footer of a Datagrid and I'd like to try and add some client side code too take out all the spaces which the user might enter by accident. The textbox is used to enter forename text so basically I need the code to strip out any spaces a user may enter. At the moment I have two validators and my html code looks as follows: -
Can someone help me enter the code I need to achieve this.
Thanks very much for your help
<FooterTemplate>
<asp:TextBox ID="add_Forename" Columns="5" Runat="Server" />
<asp:RequiredFieldValidator id="rvForename" runat="server" ErrorMessage="A Forename is required" ControlToValidate="add_Forename"
Font-Size="Small">*
</asp:RequiredFieldValidator>
<asp:regularexpressionvalidator id="revlLengthLetter" ForeColor="Red" Font-Size="Small" runat="server" ErrorMessage="Forename must be more than 2 and less than 25 characters and has to be a letter" ControlToValidate="add_Forename" ValidationExpression="^[A-Za-z]{2,25}$">*
</asp:regularexpressionvalidator>
</FooterTemplate>
Can someone help me enter the code I need to achieve this.
Thanks very much for your help
<FooterTemplate>
<asp:TextBox ID="add_Forename" Columns="5" Runat="Server" />
<asp:RequiredFieldValidator id="rvForename" runat="server" ErrorMessage="A Forename is required" ControlToValidate="add_Forename"
Font-Size="Small">*
</asp:RequiredFieldValidator>
<asp:regularexpressionvalidator id="revlLengthLetter" ForeColor="Red" Font-Size="Small" runat="server" ErrorMessage="Forename must be more than 2 and less than 25 characters and has to be a letter" ControlToValidate="add_Forename" ValidationExpression="^[A-Za-z]{2,25}$">*
</asp:regularexpressionvalidator>
</FooterTemplate>