customvalidator using clientside script in FormView

D

Dabbler

I think my CustomValidator is failing because the client side script is not
finding the controls it refers to. The validator is supposed to insure at
least one phone number is entered. Here's my script:

function ClientValidatePhones(ctl, args)
{
var txtHPhone = document.getElementById ("tbHPhone").value;
var txtWPhone = document.getElementById ("tbWPhone").value;
var txtCellPhone = document.getElementById ("tbCellPhone").value;

if (txtHPhone.length > 0 || txtWPhone.length > 0 || txtCellPhone.length
args.IsValid = true;
}else{
args.IsValid = false;
}
}
tbHPhone, tbWPhone, tbCellPhone are textboxes inside an EditItemTemplate. Is
there another way to do this?

Thanks for any help with this.
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top