Skip to content

Instantly share code, notes, and snippets.

@TonyArra
Created February 27, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TonyArra/9c9ee9d077b9612c70f2537e21213719 to your computer and use it in GitHub Desktop.
Save TonyArra/9c9ee9d077b9612c70f2537e21213719 to your computer and use it in GitHub Desktop.
$('input[name=bar1]').bind("paste", function(e){
var pastedData = e.originalEvent.clipboardData.getData('text');
var sections = pastedData.split("-");
for (var i = 0; i < sections.length; i++) {
$('input[name=bar' + (i + 1) + ']').val(sections[i]);
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment