Reputation: 678
This is what I've started out with and it only changes input#user_name upon running the script. How do I get it to live update the value?
var $username = $("input#user_email").val();
$("input#user_name").val($username);
Upvotes: 3
Views: 16577
Reputation: 348
$("input#user_email").keyup(function(){
$("input#user_name").val($(this).val());
});
if what you mean is that when you type on user_email you want that on user_name
Upvotes: 6
Reputation: 20163
$(function(){
$('input#user_email').bind('keyup',function(){
$("input#user_name").val($(this).val());
});
});
Upvotes: 4