Is there a way to get the value from one text box and add it to another using jQuery dynamically when user is typing the value to the text box? can someone please explain the method if there is any such thing?
regrds, Rangana
You mean something like http://jsfiddle.net/ZLr9N/?
$('#first').keyup(function(){
$('#second').val(this.value);
});
Its really simple, actually. First we attach a keyup
event handler on the first input
. This means that whenever somebody types something into the first input
, the function inside the keyup()
function is called. Then we copy over the value of the first input
into the second input
, with the val()
function. That's it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With