Reply
Can I use radio button to insert text into text field?
Old 11-27-2004, 08:10 AM Can I use radio button to insert text into text field?
wvmlt's Avatar
Experienced Talker

Posts: 46
I have a text field on my site
Code:
<input type=text name=useravatar value=\"$useravatar\">
where users can insert the url of an avatar. I would like to present the user a group of avatars to choose from and when one is selected, have the url entered in the text field. Can I do this or do I need to just enter the url next to the avatar and tell users to paste the url of the avatar they want to use?
wvmlt is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 11-27-2004, 10:26 AM
Unknown.

Posts: 1,693
Yea you can simply use an onclick event and have the value of the radio button as the url of the avatar...

The radio button...

<input type=\"radio\" name=\"avatar\" value=\"avatar_location.gif\" onclick=\"avatar.value=this.getAttribute('value')\ ">

The text field...

<input type=\"text\" name=\"useravatar\" value=\"$useravatar\" id=\"avatar\">


--James

Last edited by Dark-Skys99 : 11-27-2004 at 10:42 AM. Reason: Errors
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can I use radio button to insert text into text field?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10688 seconds with 12 queries