I need to be able to type in to an input and have that value show up in another input here is what I have been working with. So basically input from userreplymessage goes to input userreplydisplay.
html
<form id="userreply">
<select id="usernames">
<option value="">Users</option>
<option value="Alex">Alex</option>
<option value="Jeff">Jeff</option>
<option value="Amy">Amy</option>
<option value="Kate">Kate</option>
</select>
<input id="userreplymessage" type="text" />
<input id="userreplydisplay" type="text" />
</form>
Jquery
$(document).ready(function() {
function update() {
$('#userreplydisplay').text('startreply ' + 'middlereply ' + $('#usernames').val() + ' endreply ' + $('#userreplymessage').val());
}
$('#userreplymessage').keyup(update);
$('#usernames').change(update);
});
Both of your input elements, userreplydisplay and userreplymessage are input textboxes. The setter and the getter are both
.val(). You’re using the getter correctly, but you’re using the wrong setter.Change “text” to “val” and you’ll be fine.