Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Javascript error for a required field validator

Reply
Thread Tools

Javascript error for a required field validator

 
 
onseats.ky@gmail.com
Guest
Posts: n/a
 
      12-27-2007
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
 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      12-30-2007
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.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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



 
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
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Required Field Validator Jim Heavey ASP .Net 0 11-14-2003 07:47 PM
Required field validator problem Do ASP .Net 3 10-23-2003 12:38 AM
Required Field Validator Error ? Phil Jones ASP .Net Web Controls 0 09-23-2003 07:11 PM
Required Field Validator Client side popup Jinsong Liu ASP .Net 3 08-14-2003 07:53 PM



Advertisments