...

View Full Version : clone input to another field



ynotlim
04-30-2008, 12:25 AM
Hello,

I have two inputs:
<input type="text" id="field1" value="">
<input type="text" id="field2" value="">

As I type into field1, I want it to simultaneously show up in field2.

how do I do that?

Thanks!

Tony

mrhoo
04-30-2008, 03:23 AM
<script type="text/javascript">


window.onload= function(){
var field1= document.getElementById('field1');
var field2= document.getElementById('field2');

field1.onkeyup= function(){field2.value= field1.value}
}

</script>

ynotlim
04-30-2008, 07:05 PM
thank you !



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum