javascript problem,onchange event not working

A

archana

Hi all

I am having one user control which has textbox. At one place i added
this user control in div tag and at other place without div tag. What
i want is to add onchange event to textbox which present in user
control. I ma having some code on onchange event. What is happening
is when i press tab on textbox which is inside div tab, onchange event
is not getting fired. but in textbox which is not in div tab,
onchange happens.

can any one tell me wyhy this is happening and reson behind this?
 
G

Gregory A. Beamer

Hi all

I am having one user control which has textbox. At one place i added
this user control in div tag and at other place without div tag. What
i want is to add onchange event to textbox which present in user
control. I ma having some code on onchange event. What is happening
is when i press tab on textbox which is inside div tab, onchange event
is not getting fired. but in textbox which is not in div tab,
onchange happens.

can any one tell me wyhy this is happening and reson behind this?

I don't have enough info to give you an answer. The <div> may be the
problem, but I doubt it. There are more likely other reasons.

The first thing I would do is view source after rendering and see what
you have. This will give you a big clue on what the underlying problem
is and may give enough of a clue towards what you have to do in .NET to
fix it.

Personally, I think OnChange is a mistake in a textbox in most
instances, as it fires with every keystroke. If this is the intent,
fine, but generally the intent is when the user is finished with the
text, so the OnBlur event is generally better. It really depends on the
app, of course.

BTW, IE8 has some developer tools baked in, and there is a plugin called
FireBug. Both are very useful for "debugging" client side errors and
omissions.

Peace and Grace,
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top