about using validation with Javascript in ASP.NET

  • Thread starter Thread starter ugurceng
  • Start date Start date
U

ugurceng

Hi,

I have an aspx page that includes both search and insert screen ,
When I click the the insert button ,if required fields are blank then the
validation.js throws an error, but when I click the search button ,
validation throws error again,
how can I prevent from this problem
I mean when I click the search button,validation must return true ,because
search elements and insert elements are in the same form..
<form id="Form5" onsubmit="return checkForm(this);" name="form2" action=""
method="post"

</form>

Best Regards...

UGURCENG
 
If you are saying you want validation to fire when one button is clicked but
not the other, move the checkForm() call to the button's client-Side click
event.

someButton.Attributes.Add("onClick", "return
checkForm(document.getElementById('form5'));");

or something...

Karl
 
Thank you very much....

UGURCENG

Karl Seguin said:
If you are saying you want validation to fire when one button is clicked
but not the other, move the checkForm() call to the button's client-Side
click event.

someButton.Attributes.Add("onClick", "return
checkForm(document.getElementById('form5'));");

or something...

Karl
 

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

Back
Top