Javascript error for a required field validator

Discussion in 'ASP .Net' started by onseats.ky@gmail.com, Dec 27, 2007.

  1. Guest

    I have a strange problem with a required field validator when I have
    EnableClientScript set to true. When the client side validation fires
    I get a javascript exception inside the .net javascript. The exact
    error is "targetedControl has no properties". Looking at the .net
    script it looks like there is an event object that is expected to have
    an object named either srcElement or target which I would guess is the
    foem element to be validated. Debugging this code on the browser I see
    that both of these objects are always null.

    I have another page using the client side validation without a problem
    so it appears to be something wrong with this particular page. Also,
    I'm positive I have the framework script is available (i walked
    through it using firebug)

    Does anyone have any ideas what might be causing this?

    thanks
     
    , Dec 27, 2007
    #1
    1. Advertising

  2. In the RequiredFieldValidator, is the ControlToValidate property set to an
    existing control? Is the control that ControlToValidate refers to inside a
    Template (things can be a little tricky when validating controls inside
    Templates)? Does the RequiredFieldValidator work if you set
    EnableClientScript=False (this will help you determine whether it is a
    client-side or server-side problem)? Does the RequiredFieldValidator work if
    you have it validate a different control on the Page? Check each of these
    and see if it helps determine what is causing the problem.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    <> wrote in message
    news:...
    >I have a strange problem with a required field validator when I have
    > EnableClientScript set to true. When the client side validation fires
    > I get a javascript exception inside the .net javascript. The exact
    > error is "targetedControl has no properties". Looking at the .net
    > script it looks like there is an event object that is expected to have
    > an object named either srcElement or target which I would guess is the
    > foem element to be validated. Debugging this code on the browser I see
    > that both of these objects are always null.
    >
    > I have another page using the client side validation without a problem
    > so it appears to be something wrong with this particular page. Also,
    > I'm positive I have the framework script is available (i walked
    > through it using firebug)
    >
    > Does anyone have any ideas what might be causing this?
    >
    > thanks
     
    Nathan Sokalski, Dec 30, 2007
    #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. Jinsong Liu

    Required Field Validator Client side popup

    Jinsong Liu, Aug 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    5,511
    Guenther Liebowitz
    Aug 14, 2003
  2. Do
    Replies:
    3
    Views:
    4,425
    Mike Moore [MSFT]
    Oct 23, 2003
  3. Jim Heavey

    Required Field Validator

    Jim Heavey, Nov 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    332
    Jim Heavey
    Nov 14, 2003
  4. Phil Jones

    Required Field Validator Error ?

    Phil Jones, Sep 23, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    102
    Phil Jones
    Sep 23, 2003
  5. jr
    Replies:
    3
    Views:
    433
Loading...

Share This Page