I have two textboxes in my view,
My requirement is when I enter some text in the first textbox automatically that value should be assigned to second text box when I leave first textbox. using jquery or javascript.
thanks for your help
EDIT:
For Some reason this code is not inserting the value into seconed textbox.
http://jsfiddle.net/9tEV2/4/
Capture the onchange event of the first textbox and in the event handler assign the first textbox value to second one.
Something like:
<input type="text" id="name"/>
<input type="text" id="anotherName"/>
<script type="text/javascript">
$(function(){
$("#name").change(function(){
$("#anotherName").val($(this).val());
});
})
</script>
$('#textbox1').blur(function(e) {
$('#textbox2').val($(this).val());
});
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