![]() |
CausesValidation
I have a web page which has a bunch of validation controls on it. The page
also has another form which provides a couple of HTML text boxes and an HTML button. This functionality performs a look up. My problem is that when the user populates the information and presses the button, it causes the validation to occur on the page. How can I turn this off when the HTML button is pressed. Here is the the code for the HTML form.... <form NAME="EMAILADDR" METHOD="post" Action="http://somewhere/webapps/utilities/IMCApps?request=EmailLookup"> <span class="txtBold">Last Name: </span><input TYPE="text" Name="last" maxlength="25" size="25" /> <span class="txtBold">First Name: </span><input TYPE="text" Name="first" Maxlength="16" Size="16" /> <input Type="submit" class="btn" Value="Look up E-mail Address"> </form> Thanks in advance for your assistance. |
RE: CausesValidation
Howdy,
There are several ways to solve it. 1. Make input control runat at server by adding <input Type="submit" class="btn" runat="server" causesvalidation="false" Value="Look up E-mail Address"> 2. or set validatiogroup property of all the validation controls and buttoms that are linked together: <asp:RequiredFieldValidator runat="server" ID="val" ErrorMessage="enter some text" ControlToValidate="txt" ValidationGroup="SubmitDataGroup" Display="Dynamic" /> <asp:Button runat="server" ID="btn" Text="Submit data" ValidationGroup="SubmitDataGroup"/> hope this helps -- Milosz "JimHeavey" wrote: > I have a web page which has a bunch of validation controls on it. The page > also has another form which provides a couple of HTML text boxes and an HTML > button. This functionality performs a look up. > > My problem is that when the user populates the information and presses the > button, it causes the validation to occur on the page. How can I turn this > off when the HTML button is pressed. > > Here is the the code for the HTML form.... > > <form NAME="EMAILADDR" METHOD="post" > Action="http://somewhere/webapps/utilities/IMCApps?request=EmailLookup"> > <span class="txtBold">Last Name: </span><input TYPE="text" Name="last" > maxlength="25" size="25" /> > <span class="txtBold">First Name: </span><input TYPE="text" Name="first" > Maxlength="16" Size="16" /> > <input Type="submit" class="btn" Value="Look up E-mail Address"> > </form> > > Thanks in advance for your assistance. |
| All times are GMT. The time now is 03:01 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.