Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
181
rated 0 times [  186] [ 5]  / answers: 1 / hits: 32425  / 12 Years ago, mon, april 16, 2012, 12:00:00

I'm trying to change the value in one textfield from the value of another textfield without any submits. Example:



[Textfield 1 (type 'hello')]



[Textfield 2 ('hello' is inserted here as well)]



Below is my form:



<form action=# id=form_field>
<input type=text id=textfield1 value=>
<input type=text id=textfield2 value=>
</form>


I don't know much about JavaScript, is this even possible? Would appreciate any help.



Thanks


More From » forms

 Answers
22
<form action=# id=form_field>
<input type=text id=textfield1 value= onKeyUp=document.getElementById('textfield2').value=this.value>
<input type=text id=textfield2 value=>
</form>


see it in action:
http://jsfiddle.net/4PAKE/


[#86213] Saturday, April 14, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
charity

Total Points: 503
Total Questions: 98
Total Answers: 125

Location: Mali
Member since Fri, Dec 3, 2021
3 Years ago
;