Ask jQuery keyup event -


how can id="e3" can filled if id="e2" filled id="e1"?

checking live code here, http://jsfiddle.net/ehetv/

jquery(document).ready(function(){          jquery('#e1').on('keyup', function(){             var text = jquery(this).val();             jquery(this).next().val(text);         });          jquery('#e2').on('keyup', function(){             var text = jquery(this).val();             jquery(this).next().val(text);         });      });    <input id="e1" value="" /> <input id="e2" value="" /> <input id="e3" value="" /> 

using .trigger(eventname) can achieve that.

here triggering keyup of #e2 in #e1 keyup. #e2 keyup copies data #e3.

 jquery('#e1').on('keyup', function(){         var text = jquery(this).val();         jquery(this).next().val(text).trigger('keyup');     }); 

test demo


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -