471,337 Members | 1,121 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

about using validation with Javascript in ASP.NET

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
Nov 19 '05 #1
2 1125
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"ugurceng" <ug**@argeset.com> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #2
Thank you very much....

UGURCENG

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>,
haber iletisinde şunları yazdı:el**************@TK2MSFTNGP12.phx.gbl...
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

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"ugurceng" <ug**@argeset.com> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...
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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by EviL KerneL | last post: by
4 posts views Thread by Tim Meagher | last post: by
16 posts views Thread by Hosh | last post: by
2 posts views Thread by Martyn Fewtrell | last post: by
5 posts views Thread by Kyle | last post: by
6 posts views Thread by Peter Afonin | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.