CustomValidation

Discussion in 'ASP .Net' started by SAI, Jul 12, 2005.

  1. SAI

    SAI Guest

    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.
    SAI, Jul 12, 2005
    #1
    1. Advertising

  2. SAI

    Karl Seguin Guest

    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!)
    "SAI" <> wrote in message
    news:...
    > 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.
    >
    >
    Karl Seguin, Jul 12, 2005
    #2
    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?cm9kY2hhcg==?=

    datagrid template columns and customvalidation

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    426
    =?Utf-8?B?RmVybmFuZG8gSHVudGg=?=
    Jan 11, 2005
  2. kpg
    Replies:
    2
    Views:
    756
    Peter Blum
    Dec 22, 2004
  3. Replies:
    1
    Views:
    665
    Peter Blum
    Mar 26, 2005
  4. gane kol
    Replies:
    3
    Views:
    7,069
    William F. Robertson, Jr.
    Apr 15, 2005
  5. =?Utf-8?B?SWxsdXN0cmlz?=

    newbie seeks CustomValidation advice/problem solving...

    =?Utf-8?B?SWxsdXN0cmlz?=, Sep 8, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    521
    =?Utf-8?B?SWxsdXN0cmlz?=
    Sep 10, 2005
Loading...

Share This Page