Html Form Question

Soldato
Joined
29 Apr 2007
Posts
4,841
Location
London
Hi, wondering if you can help me.

If I have an input on an html form, can I have another input, and when you input in one, it inputs in the other one too?

I dont mind if its with javascript, but it cant be with php, as it may interfere with my form parser.

Thanks, Ross
 
Code:
<input type="text" id="one" name="one" onkeyup="document.getElementById('two').value = document.getElementById('one').value" />
<input type="text" id="two" name="two" readonly="readonly" />
 
Thanks. Is there a way to get it to do it on something else than onkeyup? It gets filled in by a pop up calender you see.

would onsubmit work?
 
Last edited:
Thanks. Is there a way to get it to do it on something else than onkeyup? It gets filled in by a pop up calender you see.

would onsubmit work?

can you post the code for the pop up calender as the easiest option then would be to repeat the code which fills input field one and make it also fill in input field 2

if the second input field does not need to be shown you could alternatively just have php say that input field 2 = input field 1 when the form is finlaly submitted
 
I fixed it! Thanks I could not have done it without your help.

What I did is i put the code on the submit button using an onclick so when the submit button is clicked it copies over and the form is submitted! Thankyou!

:) :) :) :)
 
Back
Top Bottom