Combining the contents of 2 inputboxes into a third

liunx

Guest
I was wondering how it would be possible to have 2 textboxes where someone can enter their information and have a third box that displays the combined results.<br />
<br />
For example: The first 2 boxes would be text boxes, and the third would be hidden.<br />
<br />
<br />
BOX #1 : 2003<br />
BOX #2 : 124637<br />
<br />
BOX #3 : 2003124637<br />
<br />
This is essentially to be used as a means of creating a unique number based on 2 entries. In my case, it will be User ID and a Date/Time Stamp in the first 2 boxes and the result in the third box.<br />
<br />
Thanks!<!--content-->But how is this going to work for those who do not use JavaScript?<!--content-->^^ I don't know. I know JavaScript will be required to do it... I just don't know how to do it. :confused:<!--content-->Originally posted by kahlua17 <br />
^^ I don't know. I know JavaScript will be required to do it... I just don't know how to do it. :confused: You'll have to use some sort of server side script then. What do you have available?<!--content-->You'll have to use some sort of server side script then. What do you have available? <br />
<br />
I am using MYSQL.<!--content-->Assuming javascript is available it's relatively simple.<br />
<br />
<br />
...<br />
<script><br />
function CombineText(){<br />
alert(T1.value);<br />
T3.value=T1.value+T2.value;<br />
}<br />
</script><br />
...<br />
<input type='text' name='T1' onchange='CombineText();'><br />
<input type='text' name='T2' onchange='CombineText();'><br />
<input type='text' name='T3' readonly><br />
...<!--content-->Worked like a charm!! :D Thanks a lot!!<!--content-->
 
Back
Top