SunQuest
           HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 20th, 2000, 11:49 AM
Patrick Kellum Patrick Kellum is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Yuba City, CA USA
Posts: 2 Patrick Kellum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I don't know JavaScript so I havn't been able to figure this out, sorry. What I need to do is whenever someone selects a radio button, a value is changed in a text input.

In the example form code below, when the user selects a radio button, the value of the text input needs to change. It sounds easy, but I can't figure it out.

Thanks,

Patrick

<INPUT TYPE="text" NAME="dat_file">

<INPUT TYPE="radio" NAME="txt_file" VALUE="file_1.txt"> File 1<BR>

<INPUT TYPE="radio" NAME="txt_file" VALUE="file_2.txt"> File 2<BR>

<INPUT TYPE="radio" NAME="txt_file" VALUE="file_3.txt"> File 3<BR>



Reply With Quote
  #2  
Old July 20th, 2000, 03:05 PM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 741 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
there are 2 ways to skin this cat - this is my preffered option.

<html><head>
<script>
function rad(txt){document.fname.dat_file.value=txt;}
</script></head>
<body bgcolor="#ffffff">
<form name=fname>
<INPUT TYPE="text" NAME="dat_file">
<INPUT TYPE="radio" NAME="txt_file" VALUE="file_1.txt" onclick="rad('whatever you want here')"> File 1<BR>
<INPUT TYPE="radio" NAME="txt_file" VALUE="file_2.txt" onclick="rad('maybe you want this?')"> File 2<BR>
<INPUT TYPE="radio" NAME="txt_file" VALUE="file_3.txt" onclick="rad('nah! this is nicer')"> File 3<BR>
</form>
</body></html>

Regards,


------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
  #3  
Old July 20th, 2000, 07:57 PM
Patrick Kellum Patrick Kellum is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Yuba City, CA USA
Posts: 2 Patrick Kellum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool, thanks for the help. Seems simple now that I look at it, but I wasn't having any luck on my own.

Thanks,

Patrick

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Automaticly set value of text input?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway