Jump to content

Help Append two textfields into a third one with a space


dicky18

Recommended Posts

HI i dont know if its a stupid question but im so new to php you can forgive  me

well the thing is i have 3 text fields

 

textfield1

textfield2

textfield3

 

I want to add textfield 1 with textfield 2 and display it in a hidden textfield3 with a space between the text.

 

Textfield1(Sam) + Textfield2(Yam) = Textfield3 (Sam Yam)

thanks in advance

<script language="javascript">

function mearge(){

document.getElementById('a3').value =document.getElementById('a1').value + "  " +document.getElementById('a2').value ;

}

</script>

<form name="a" method="post" action="test.php">

<input type="text" name="a1" id="a1"/>

<input type="text" name="a2" id="a2"/>

<input type="text" name="a3" id="a3"/>

 

<input type="button" name="a11" id="a11" onclick="javascript:mearge();"/>

</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.