Forum Moderators: open

Message Too Old, No Replies

change textfield to variable

         

Shawazi

4:13 am on Apr 14, 2004 (gmt 0)

10+ Year Member



I am not done with this code yet but I was wondering about my onClick command. Using the code I have now makes the hidden field 'isay' have the value "say". I want it to be so that if in the textarea i write "Hello World." The onClick command will make isay have the value "Hello World." I don't really know javascript so any help is appreciated.

<form action='dave.php#sent' method='post' target='dave' name='sendform'>
<textarea name='say' cols='49' rows='10'></textarea><br>
<input type='hidden' name='sending' value='1'>
<input type='hidden' name='isay' >
<input type='submit' name='submit' value='Send' onClick="document.sendform.isay.value='say';">
</form>

Rambo Tribble

1:30 pm on Apr 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I understand you correctly, this should work:

onclick="document.sendform.isay.value=document.sendform.say.value;"

The question is, "Why not just use the "say" value directly?"