Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery trigger key event to textbox from another text box
    primarykey
    data
    text
    <p>i want send a key event to simulate <code>mytext2</code> from <code>mytext1</code> . that means when i type "a" in <code>mytext1</code> it should display in <code>mytext2</code> also.further when i press backspace on <code>mytext1</code> it should be affected in to <code>mytext2</code> also. in some case mytext1 has nothing but <code>mytext2</code> remaining something,in such a case when i press backspace on <code>mytext1</code> it should be clear last letter in <code>mytext2</code> ('it says that i don't want both text box content to be equal'). here is my code:</p> <pre><code>$('#mytext1').on('keydown',function(e){ var keyCode = e.keyCode || e.which; $('#mytext2').trigger($.Event("keypress", { keyCode: keyCode })); }); $('#mytext1').on('keypress',function(e){ var keyCode = e.keyCode || e.which; this.val()+=keyCode; }); &lt;input type='text' id='mytext1' value='this not eq to txt2'/&gt; &lt;input type='text' id='mytext2'value='this not eq to txt1'/&gt; </code></pre> <p><em>*</em> even delete, backspace event shuld be trigger to mytext2. just like i'm doing it on mytext2.think that i put same key press on different text box initially with different content</p> <p>thnks,help me. ------------------update------------------------------------------------------------------- think initially mytext1 has a value "ca" mytext2 has "bea" , when i press "t" on <code>mytext1</code> it should be affected in to <code>mytext2</code> . then <code>mytext1</code> willbe "cat" mytext2 willbe "beat". if i press backspace twice in <code>mytext1</code> it will be resulted as <code>mytext1</code>=>"c" ,mytext2=>"be". sorry for my poor explaninig.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload