CausesValidation

G

Guest

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top