javascript problem,onchange event not working

  • Thread starter Thread starter archana
  • Start date Start date
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?
 
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,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top