[Solved] Javascript: item value to a textfield

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

[Solved] Javascript: item value to a textfield

Post by Shendemiar »

I've seen code here somewhere that adds the value of an option to a textfield, but i couldn't find it. So:

I'd like a textbox named "Name" to have a value, when an option on a same form is clicked.

Something like this, but since i'm a javascript dummie, someone need to think it for me:

Code: Select all

<?php
echo "<INPUT TYPE=\"RADIO\" name=\"Renamee\" value=\"$key.$k2.$v2\" 
      onchange=\"document.forms['Form1'].elements['Name'].value = '$v2';\">
      $tmp: $v2<BR>\n";
?>
Last edited by Shendemiar on Tue Apr 05, 2005 4:10 pm, edited 1 time in total.
Shendemiar
Forum Contributor
Posts: 404
Joined: Thu Jan 08, 2004 8:28 am

Post by Shendemiar »

It was an easy one. I just changed the onchange to onclick! Damn i'm smart!
Post Reply