473,382 Members | 1,349 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,382 software developers and data experts.

Javascript Validition and Required Validator

Hello, I created a simple javascipt routine to do some validation. I
attached that script to my ASP Button with the following code...
cmdAddTask.Attributes["onclick"] = "javascript:return
ValidateItemsSelected(lstSelectedGroupOwners, spnErrSelectedGroupOwners);";

After I did this, my "asp:requiredvalidator" stopped working. If I remove
the code above, and re-run, my ASP RequiredValidator works just fine.

I am guess that I am clobbering something....what is the appropriate
technique to get both to work?

Thanks!!
Nov 19 '05 #1
2 1769
Why not simply use a customValidator in conjuction with the
requiredvalidator that's what it's made for:

http://aspnet.4guysfromrolla.com/articles/073102-1.aspx

if you scroll near the bottom you'll see an example of it using client-side
javascript.

Hope this helps,
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:C0**********************************@microsof t.com...
Hello, I created a simple javascipt routine to do some validation. I
attached that script to my ASP Button with the following code...
cmdAddTask.Attributes["onclick"] = "javascript:return
ValidateItemsSelected(lstSelectedGroupOwners, spnErrSelectedGroupOwners);";
After I did this, my "asp:requiredvalidator" stopped working. If I remove
the code above, and re-run, my ASP RequiredValidator works just fine.

I am guess that I am clobbering something....what is the appropriate
technique to get both to work?

Thanks!!

Nov 19 '05 #2
the supported method is to create a custom validator, and let the standard
validation call it. the hack is to call the validation routine yourself. a
view source will give you all the info you need.

-- bruce (sqlwork.com)

"Jim Heavey" <Ji*******@discussions.microsoft.com> wrote in message
news:C0**********************************@microsof t.com...
| Hello, I created a simple javascipt routine to do some validation. I
| attached that script to my ASP Button with the following code...
| cmdAddTask.Attributes["onclick"] = "javascript:return
| ValidateItemsSelected(lstSelectedGroupOwners,
spnErrSelectedGroupOwners);";
|
| After I did this, my "asp:requiredvalidator" stopped working. If I remove
| the code above, and re-run, my ASP RequiredValidator works just fine.
|
| I am guess that I am clobbering something....what is the appropriate
| technique to get both to work?
|
| Thanks!!
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex M | last post by:
I'm trying to use the jakarta struts client side javascript validators and the validators are working, but they are not showing the popup messages. I have the message keys defined in the...
16
by: Safalra | last post by:
Frequently in ciwah people say 'but what about the users without JavaScript?', so I decided to do an experiment. It suggests 35% internet users do not have JavaScript turned on in their browsers....
4
by: frogman042 | last post by:
My daughter is playing around trying to learn JavaScript and she wrote a small program that prints out a message in increasing and decreasing font size and color changes. She is using document...
4
by: TJS | last post by:
how do I get "onSubmit" to work in .net ? <Form id="Form1" name="Form1" method="post" onSubmit="return validateStandard(this, 'error');" runat="server">
1
by: Sky Kim | last post by:
Hi, all. I got stuck...here.. Let me simplify my problem.. I added One TextBox, and Required Validator associated with the textbox. And, Submit button. When submit is clicked it should do...
1
by: Bishoy George | last post by:
I have an html button that reads a text box and runs a javascript. I made a Required Validator on that text box , any web button follows that validator. My html button does not follow the...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
2
by: Navodit | last post by:
Hi I am new to Javascript and am not sure what is the difference between the following two statements: <script type="text/javascript"> ..... </script>
1
by: onseats.ky | last post by:
I have a strange problem with a required field validator when I have EnableClientScript set to true. When the client side validation fires I get a javascript exception inside the .net javascript....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.