Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 2nd, 2005, 01:56 AM
Authorized User
Join Date: Apr 2005
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.
Old April 2nd, 2005, 02:22 AM
Authorized User
Join Date: Apr 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts

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

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

function textme () {

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

Old April 4th, 2005, 04:03 AM
Friend of Wrox
Join Date: Oct 2004
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

Please find the answer at

Cheers :)


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

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