...

View Full Version : Help with form please



DamageINC2624
01-28-2005, 09:05 PM
Hello, i am making a form for a website in which i need to have the user fill in textfields and then have the text that is in the texfields appear in a textarea when a button is pressed.

I havent been able to find any resources on what i want to do, i know how to write the code i need in visual basic but i do not know how to make the same thing happen in HTML or javascript.

Any help would be appretiated thanks.

_Aerospace_Eng_
01-28-2005, 09:25 PM
u can try something like this

<form action="/">
<input type="text" id="stuff" size="10">
<input type="button" value="Send to text box" onclick="textstuff.value=stuff.value">
</form>
<textarea id="textstuff" rows=8 cols=30></textarea>

DamageINC2624
01-28-2005, 09:28 PM
thankyou i think thats exactly what i needed

DamageINC2624
01-28-2005, 09:37 PM
actually one more thing i could use (sorry for double post)

onclick="textstuff.value=lastname.value+firstname.value"

i have two text boxes, one for first name and one for last, anyway i can get the code to insert a comma between the two.

_Aerospace_Eng_
01-28-2005, 10:10 PM
try this then

<form action="/">
<input type="text" id="lastname" size="10">
<input type="text" id="firstname" size="10">
<input type="hidden" value=", " id="comma">
<input type="button" value="Send to text box" onclick="textstuff.value=lastname.value+comma.value+firstname.value">
</form>
<textarea id="textstuff" rows=8 cols=30></textarea>

DamageINC2624
01-28-2005, 10:20 PM
ah thanks alot again

mindlessLemming
01-28-2005, 11:18 PM
try this then

<form action="/">
<input type="text" id="lastname" size="10">
<input type="text" id="firstname" size="10">
<input type="hidden" value=", " id="comma">
<input type="button" value="Send to text box" onclick="textstuff.value=lastname.value+comma.value+firstname.value">
</form>
<textarea id="textstuff" rows=8 cols=30></textarea>

Bleh? a hidden text field to add a comma? :confused:

Use this:


<form action="/">
<input type="text" id="lastname" size="10">
<input type="text" id="firstname" size="10">
<input type="button" value="Send to text box" onclick="textstuff.value=lastname.value + ',' + firstname.value;">
<textarea id="textstuff" rows=8 cols=30></textarea>
</form>

_Aerospace_Eng_
01-28-2005, 11:33 PM
:eek:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum