Board index » Web Programming » Javascript Validition and Required Validator

Javascript Validition and Required Validator

Web Programming317
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!!


-
 

Re:Javascript Validition and Required Validator

Why not simply use a customValidator in conjuction with the

requiredvalidator that's what it's made for:



aspnet.4guysfromrolla.com/articles/073102-1.aspx">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

www.openmymind.net/">www.openmymind.net/





"Jim Heavey" <JimHeavey@discussions.microsoft.com>wrote in message

Quote
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!!





-

Re:Javascript Validition and Required Validator

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" <JimHeavey@discussions.microsoft.com>wrote in message

| 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!!





-