javascript - onPropertyChange only working in IE browser - Stack Overflow

onPropertyChange is only working in IE.I used onPropertyChange for entering some text in one text box

onPropertyChange is only working in IE. I used onPropertyChange for entering some text in one text box, at the same time same text displays in another text box. Are there any other methods are available to solve the problem?

HTML:

<input type="text" id="firstName" name="firstName" value="" maxlength="64"size="30" class="controlStyle" onPropertyChange="displayName(this, document.frmSkills.EmpLn, document.frmSkills.EmpDn,displayFormat)">

onPropertyChange is only working in IE. I used onPropertyChange for entering some text in one text box, at the same time same text displays in another text box. Are there any other methods are available to solve the problem?

HTML:

<input type="text" id="firstName" name="firstName" value="" maxlength="64"size="30" class="controlStyle" onPropertyChange="displayName(this, document.frmSkills.EmpLn, document.frmSkills.EmpDn,displayFormat)">
Share Improve this question edited Mar 16, 2023 at 18:47 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Dec 13, 2012 at 13:39 ELAYARAJAELAYARAJA 5213 gold badges10 silver badges23 bronze badges 2
  • 1 Have you tried binding to keyboard events? jQuery Keyboard Events will make it easy. – Dani P. Commented Dec 13, 2012 at 13:41
  • @DaniP. my requirement is when i enter some text in first text box, the same text follow in second text box. i want the solution for this. – ELAYARAJA Commented Dec 13, 2012 at 13:47
Add a ment  | 

2 Answers 2

Reset to default 2

i got the solution for above question, below is the code. thank you all for your kind reply.

window.onload=function() {
  document.getElementById("textarea_one").onkeyup=function() {     
      document.getElementById("textarea_three").value=this.value+ " "+document.getElementById("textarea_two").value;
  }
  document.getElementById("textarea_two").onkeyup=function() {     
      document.getElementById("textarea_three").value=document.getElementById("textarea_one").value+" "+this.value;
  }
} 

The other browsers support an event on any text-input event (oninput).

You'll need to handle both events to cover IE as well.

textelement.addEventListener('input',function,false)) or textelement.oninput=

this is from: http://help.dottoro./ljhxklln.php

The oninput event is supported in Internet Explorer from version 9, but The oninput event is buggy in Internet Explorer 9

The oninput is useful if you want to detect when the contents of a textarea, input:text, input:password or input:search element have changed, because the onchange event on these elements fires when the element loses focus, not immediately after the modification. The oninput event is supported in Internet Explorer from version 9. If you need an event that fires when the contents of these elements are modified in Internet Explorer before version 9, use the onpropertychange event.

The oninput event is buggy in Internet Explorer 9. It is not fired when characters are deleted from a text field through the user interface only when characters are inserted. Although the onpropertychange event is supported in Internet Explorer 9, but similarly to the oninput event, it is also buggy, it is not fired on deletion. Since characters can be deleted in several ways (Backspace and Delete keys, CTRL + X, Cut and Delete mand in context menu), there is no good solution to detect all changes. If characters are deleted by the Delete mand of the context menu, the modification cannot be detected in JavaScript in Internet Explorer 9. Always use the addEventListener method in Internet Explorer 9 to register an event listener for the oninput event. The attachEvent method does not work for the oninput event. The oninput event is not supported for textarea elements in Safari before version 5, use the textInput event instead in that browsers.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745222181a4617298.html

相关推荐

  • javascript - onPropertyChange only working in IE browser - Stack Overflow

    onPropertyChange is only working in IE.I used onPropertyChange for entering some text in one text box

    6小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信