Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery to copy two input fields into one with a space between

jQuery(function($) {
  var $firstname = $('input[name="firstname"]');
  var $lastname = $('input[name="lastname"]');
  var $fullname = $('input[name="fullname"]');

  $firstname.add($lastname).keyup(function() {
    $fullname.val($firstname.val() + ' ' + $lastname.val());
  });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #copy #input #fields #space
ADD COMMENT
Topic
Name
1+2 =