Want to fill a form box2 automatically based on form box1 input [on the same page]

M

Matt MC

How would I put this together so,

<input name="input1" type="text">

<input name="input2" value="whatever is typed into input1" type="text">

I would like to be able to type something in input1, and see it type
into input2
 
R

RobB

Matt said:
How would I put this together so,

<input name="input1" type="text">

<input name="input2" value="whatever is typed into input1" type="text">

I would like to be able to type something in input1, and see it type
into input2

Assuming the same form....

<input
type="text"
name="input1"
value=""
onkeyup="this.form.input2.value=this.value">
<input
type="text"
name="input2"
value=""
readonly="readonly">
 
T

Thomas 'PointedEars' Lahn

Matt said:
How would I put this together so,

<input name="input1" type="text">

<input name="input2" value="whatever is typed into input1" type="text">

I would like to be able to type something in input1, and see it type
into input2

<input name="input1"
onkeyup="this.form.elements['input2'].value = this.value;"
onmouseup="this.onkeyup(event);">
<input name="input2" value="whatever is typed into input1">

You don't need to specify type="text", that's the initial value of the
attribute.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top