Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 2nd, 2005, 01:56 AM
Authorized User
 
Join Date: Apr 2005
Location: , , USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Toggle active state of text area with radio button

I have 5 radio buttons. A B C D E
B (if selected) needs to activate a text field of 25 chars
E (if selected) needs to activate a text field of 10 chars

if user selects B, then user can type in "happy"; user then changes mind and selects D. "happy" is erased and the textfield is disabled. user then changes mind again and selects B and this time types in "not so happy"; then user changes mind selects E and types in "whatever" (B is blanked and disabled). then user selects A and hits submit. (B and E should be blanked and disabled... form returns value A as submited.
__________________
In a world of give and take, take all you can and you die with nothing.  Give all you can and you  die with honor.
Reply With Quote
  #2 (permalink)  
Old April 2nd, 2005, 02:22 AM
Authorized User
 
Join Date: Apr 2005
Location: , , USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cheap example of using one checkbox to toggle one textbox... blah!



<html><head><title>Toggle My Text Box</title>
<script language="JavaScript">

function textme () {
if(document.f1.mycheckbox.checked)
{
document.f1.textinput.disabled=false;
}
else
{
document.f1.textinput.disabled=true;
}
}
</script>

<form action="" method="" name="f1">
  <input type="text" disabled size="10" name="textinput">
  <input type="checkbox" onclick="textme()" name="mycheckbox" value="on" >
 <br>
 <input type="submit" value="Add">
  <input type="reset" value="Clear">
  </form>
</body></html>


Reply With Quote
  #3 (permalink)  
Old April 4th, 2005, 04:03 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Please find the answer at
http://p2p.wrox.com/topic.asp?TOPIC_ID=28746

Cheers :)

vinod
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit text to main page from text area... user0b PHP How-To 2 June 30th, 2008 09:52 PM
Toggle active state of textbox with a radio button Hatchingabrain Javascript How-To 2 April 4th, 2005 07:13 AM
Toggle Button Problem cco2000 Access 0 March 23rd, 2004 09:26 PM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM
Display text onmouseover of radio button(ALT?) savoym HTML Code Clinic 1 September 16th, 2003 11:27 AM



All times are GMT -4. The time now is 02:27 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.