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'); });
Comments
Post a Comment