Make Enter key invoke onchange event

We have an app where we have a textbox where we have an onchange event. Here is the form code:

<input type="password" style="background color: #FF0000;" name="conf" size="10" class="pt9" disabled="true" onChange="chk_text();">

We want it to be such that if the person types text & hit's the ENTER key it will invoke the onchange event. It does that in FireFox.

How can we make it do that in IE?
Richard KortsAsked:
Who is Participating?
David S.Connect With a Mentor Commented:
Inline events are ugly but try this:

onkeypress="var k=event.keyCode||event.which;if(k==13){this.onchange();}"
Richard KortsAuthor Commented:
To Kravimir:

I'm not clear on where the onkeypress....... goes. Does it go inside the <input type ...> tag?

David S.Commented:
Yes, it would go inside that tag.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.