473,772 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript error for a required field validator

I have a strange problem with a required field validator when I have
EnableClientScr ipt set to true. When the client side validation fires
I get a javascript exception inside the .net javascript. The exact
error is "targetedContro l 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
1 2774
In the RequiredFieldVa lidator, is the ControlToValida te property set to an
existing control? Is the control that ControlToValida te refers to inside a
Template (things can be a little tricky when validating controls inside
Templates)? Does the RequiredFieldVa lidator work if you set
EnableClientScr ipt=False (this will help you determine whether it is a
client-side or server-side problem)? Does the RequiredFieldVa lidator 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********@hotm ail.com
http://www.nathansokalski.com/

<on********@gma il.comwrote in message
news:84******** *************** ***********@y5g 2000hsf.googleg roups.com...
>I have a strange problem with a required field validator when I have
EnableClientScr ipt set to true. When the client side validation fires
I get a javascript exception inside the .net javascript. The exact
error is "targetedContro l 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9724
by: Alex M | last post by:
I'm trying to use the jakarta struts client side javascript validators and the validators are working, but they are not showing the popup messages. I have the message keys defined in the ApplicationResources.properties file, the propertise file is in the right location, it is referenced from the struts-config.xml, but still no messages. For example, submitting a form that violates the required field validator, just causes it to do...
16
2701
by: Safalra | last post by:
Frequently in ciwah people say 'but what about the users without JavaScript?', so I decided to do an experiment. It suggests 35% internet users do not have JavaScript turned on in their browsers. I'd appreciate it if people here had a look at my page on the experiment, and tell me if they see any methodological flaws, before I go and publicise it more widely: http://www.safalra.com/hypertext/html/nojavascript.html --- Safalra (Stephen...
2
683
by: Martin | last post by:
Dear Group It says in MSDN that a field can be associated with more than one validators but can one validator be associated with more than one field? Or do I need a validator for each field? How does it work? Using Handlers? Thanks for your efforts! Martin
2
9873
by: Dot net work | last post by:
Hello. Say I have a .net textbox that uses a .net regularexpressionvalidator. If the regular expression fails, is it possible to launch a small client side javascript function to do something, such as change the border color of the textbox to red? That would look quite nice: if the expression fails, the red validator text is shown, plus the textbox's border goes red. TIA,
2
5643
by: Helen | last post by:
I'm having trouble changing the text colour of the validators I'm using on a webform. I want the styling to be done using a CSS class that is attached to the table cell that my validators live in, but this is overriden by the inline style that is being output by default. This is what I've tried to override the style so far: <asp:requiredfieldvalidator id="YesNoValidator" runat="server" errormessage="This field is required"...
4
2552
by: TJS | last post by:
how do I get "onSubmit" to work in .net ? <Form id="Form1" name="Form1" method="post" onSubmit="return validateStandard(this, 'error');" runat="server">
8
3674
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
0
1756
by: nimeshdotnet | last post by:
Hi All, I have a textbox whose readonly property is set to true. This textbox is also guarded by a required field validator. What i m doing that I have a calendar control whose on date selection i am filling the this textbox , it works fine when i am in development server. But whenever i moved my code to hosting server the required field validator stops the form being submitted. If I remove the readonly property on hosting server then it...
2
1328
by: sasierkha | last post by:
I have two options yes and no in option button when the user select the option yes it has two textbox with required field validator if value is entered no pbm otherwise error message will be displayed . if the user select no option a list of textbox with loginname,password,emailId etc are displayed with required field validator is used. my problem is when the user select the yes option and enters the values for the two textbox and...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.