javascript references becoming undefined when adding validators

G

Guest

I have an ASP.Net text box which I am adding a javascript event (onChange) at
runtime. It passes a parameter which is another control which I am getting
the name for from the ClientID property.

So when rendered looks like:

<input name="txtVal" type="text" id="txtVal" onChange="DoCalc(txtVal2);"/>

This works fine, but as soon as I add a rangeValidator to the txtVal2
control and the event fires it fails with a txtVal2 is undefined error?
Removing the validator recifies the problem.

Any help would be appreciated.
 
G

Guest

Not sure what could be this issue.. But have you tried
onChange="DoCalc(this);" ?

this will pass the reference of object making the function call...
 
G

Guest

Unfortunatley it needs to pass a different control to a function in a
javascript file file so even if this worked i wouldnt allow the desired
functionality.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Validators 1
Validators 0
Dynamic Validators 0
How to use ASP.NET validators 4
multiview and validators 0
Validators on dynamic UserControls 3
Dynamic Validators 0
Validators and Dynamic Controls 1

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top