disable requiredfieldvalidator when clicking on submit button

J

James Brett

I have one form on the page but have multiple submit buttons for different
elements. When clicking on a button not associated with the required
elements the validator popup still comes up.

How can I disable requiredfieldvalidator fields when I click on non
associated button?

Cheers
James
 
S

S. Justin Gengo

James,

That depends. If the button does not have to be associated with any
validators on the page at all then you can set the button's CausesValidation
property to false.

If the button has to trigger some validators but not others then you'll have
to create a javascript that fires when the button is clicked. The javascript
would then have to set each validator's "enabled" attribute to false (in the
client side code) for each validator that shouldn't fire.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
J

James Brett

How is this done when the button already has an onClick event for the
validator? eg

<input type="submit" name="btnDataset" value="Update Dataset" onclick="if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnDataset" class="button" />

Cheers
James
 
J

James Brett

All working fine now

Cheers
James



James Brett said:
How is this done when the button already has an onClick event for the
validator? eg

<input type="submit" name="btnDataset" value="Update Dataset" onclick="if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnDataset" class="button" />

Cheers
James
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top