johnfm
07-01-2011, 09:17 AM
Hi,
I'm trying to mirror two textboxes with the following:
<form>
<input type="text" id="0" name="tb1[]" onkeyup="document.getElementsByName('tb2[]')[this.id].setAttribute('value',this.value)">
<input type="text" id="0" name="tb2[]" onkeyup="document.getElementsByName('tb1[]')[this.id].setAttribute('value',this.value)">
</form>
If I start by picking the first box and typing it appears automatically in the second textbox. It works the same if if i start by picking the second box. However after entering text into one of the textboxes and having it mirrored, if I select the other textbox and make a change it isn't mirrored.
Any suggestions? Thanks!
I'm trying to mirror two textboxes with the following:
<form>
<input type="text" id="0" name="tb1[]" onkeyup="document.getElementsByName('tb2[]')[this.id].setAttribute('value',this.value)">
<input type="text" id="0" name="tb2[]" onkeyup="document.getElementsByName('tb1[]')[this.id].setAttribute('value',this.value)">
</form>
If I start by picking the first box and typing it appears automatically in the second textbox. It works the same if if i start by picking the second box. However after entering text into one of the textboxes and having it mirrored, if I select the other textbox and make a change it isn't mirrored.
Any suggestions? Thanks!