473,378 Members | 1,066 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1188
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have 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...

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.