Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy value to textitem onclick on Radio

Status
Not open for further replies.

yash

Programmer
Apr 9, 2001
46
IN
Hi,
Can anubody let me know How to copy value of Radio Item on Click to Text Item
------------
<p><input type=&quot;text&quot; name=&quot;T1&quot; size=&quot;20&quot;></p>

<p><input type=&quot;radio&quot; name=&quot;R1&quot; value=&quot;V1&quot; checked >
<input type=&quot;radio&quot; name=&quot;R1&quot; value=&quot;V2&quot;>
</p>
------------
My Best Regards..
Yash
 
worked for me:

<form>
<p><input type=&quot;text&quot; name=&quot;T1&quot; size=&quot;20&quot;></p>

<p><input type=&quot;radio&quot; name=&quot;R1&quot; value=&quot;V1&quot; onclick=&quot;this.form.T1.value=this.value&quot; checked >
<input type=&quot;radio&quot; name=&quot;R1&quot; value=&quot;V2&quot; onclick=&quot;this.form.T1.value=this.value&quot;>
</p>
</form> jared@eae.net -
 
Test this out thoroughly! I've had major problems trying to use the value of a radio button in javascript! The value always passes through to cgi programs fine, but it radioButton.value doesn't seem to work reliably.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks Buddy,,,

Can i ask one more question...??

How can i copy half value of Radio Value to Two Text Item..
Means if value of Radio Value is 12:24am
then i want to copy 12:24 to Text T1 and &quot;am&quot; to Text T2..
------------------
<form>
<p><input type=&quot;text&quot; name=&quot;T1&quot; size=&quot;20&quot;></p>

<p><input type=&quot;radio&quot; name=&quot;R1&quot; value=&quot;V1&quot; onclick=&quot;this.form.T1.value=this.value&quot; checked >
<input type=&quot;radio&quot; name=&quot;R1&quot; value=&quot;V2&quot; onclick=&quot;this.form.T1.value=this.value&quot;>
</p>
</form>
------------------
Once again Thank you very much...
Yash
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top