I have two forms.
I want to copy the value of one of the text fields in form 1 into another in form 2.
Text field names and ids are different.
How can I achieve this?
This didn't work:
document.getElementById('name').value = document.getElementById('user').value;
Thanks!
If you're asking for jQuery you could try:
$("#name").val($("#user").val());
http://jsbin.com/exudif/2/
$(document).ready(function()
{
$('#btn1').click(function()
{
$('#field2').val($('#field1').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