By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

Javascript error for a required field validator

P: n/a
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 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
nj********@hotmail.com
http://www.nathansokalski.com/

<on********@gmail.comwrote in message
news:84**********************************@y5g2000h sf.googlegroups.com...
>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 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.