customvalidator using clientside script in FormView

Discussion in 'ASP .Net Web Services' started by Dabbler, Apr 13, 2006.

  1. Dabbler

    Dabbler Guest

    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.
    Dabbler, Apr 13, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9u?=

    ClientSide Script Errors

    =?Utf-8?B?Um9u?=, May 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    338
    =?Utf-8?B?Um9u?=
    May 24, 2006
  2. Chris

    Formview within Formview

    Chris, May 19, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    507
    Chris
    May 19, 2007
  3. Papanii

    firing order fo clientSide script

    Papanii, May 29, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    363
    Papanii
    May 29, 2007
  4. Mo

    Server side CustomValidator and FormView

    Mo, Mar 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    136
  5. J. Cairn

    CustomValidator not working in FormView

    J. Cairn, Sep 16, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    399
    Forum
    Sep 20, 2007
Loading...

Share This Page