Satch3000 Satch3000 - 1 year ago 65
jQuery Question

Synchonise 2 input fields, can it be done using jQuery?

Can jQuery synchronise or copy the text of one input field to another when input A is modified? For example:

<input id="input_A" type="text" /> ...If I type something here

<input id="input_B" type="text" /> ... It will be copied here

Can jQuery Do this?

Answer Source

Try this:

$("#input_A").bind("keyup paste", function() {

For jQuery 1.7+ use on:

$("#input_A").on("keyup paste", function() {

Example fiddle

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download