CustomValidation

S

SAI

Should I bind one of the controls to the CustomValidation Object? e.g. bind
text box to it. In some cases, I may need to check 2 web object contents.
How to do it in one CustomValidation Object?

I tried to bind a text box to CustomValidation Object and set the Client
Validation to TRUE. Then I write a javascript to validate. It is no any
action about the checking. Any suggestion? thanks.
 
K

Karl Seguin

You don't bind controls to validators...if you mean use the
"ControlToValidate" you can leave it blank in the case of custom
validator....in custom validator on the client side, you need to get a
reference to the control yourself:

function Validate(src, args)
{
var txt = document.getElementById("myTextbox");
if (txt.value == "")
{
args.IsValid = false;
}
}

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top