473,473 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1193
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Coleen | last post by:
Please see threads on "Dumb question about Message boxes" - I went to the specified link - this works great if all you want to do is display a message box before any of your script behind the...
5
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce...
4
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
4
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
5
by: Kyle | last post by:
On my Development System, all the page validation controls work fine (WinXP Pro + SP2, VS.NET 2003, .NET v1.1.4322). On the Production System, none of the page validation controls are working...
1
by: APA | last post by:
Well, I've figured out a way around this mess. I have no idea why it doesn't work the way I think it should but I do know how to get it to work. The scenario is that I have a form that has one...
6
by: Peter Afonin | last post by:
Hello, I'm creating an application in ASP.NET 1.1. I need to check whether at least one checkbox in my datagrid has been checked. To do this, I'm using Javascript - I'm adding this code to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.