Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > customvalidator using clientside script in FormView

Reply
Thread Tools

customvalidator using clientside script in FormView

 
 
Dabbler
Guest
Posts: n/a
 
      04-13-2006
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
> 0){

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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CustomValidator not working in FormView J. Cairn ASP .Net Web Controls 1 09-20-2007 04:51 PM
firing order fo clientSide script Papanii ASP .Net 3 05-29-2007 08:12 PM
Formview within Formview Chris ASP .Net 0 05-19-2007 04:12 PM
ClientSide Script Errors =?Utf-8?B?Um9u?= ASP .Net 0 05-24-2006 01:39 AM
Server side CustomValidator and FormView Mo ASP .Net Web Controls 0 03-02-2005 09:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57