Solved

Have an inout hidden field if question to previous radio button is checked or clicked

Posted on 2004-04-01
3
197 Views
Last Modified: 2013-12-24
How do I code the following:

If a previous radio button is clicked then I want an input type hidden field to take place

I'm using javascript and coldfusion
0
Comment
Question by:gaby22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

by:CFDevHead
ID: 10734067
previous radio button from the same page???
0
 

Author Comment

by:gaby22
ID: 10734213
yes same page
0
 
LVL 15

Accepted Solution

by:
tim_cs earned 500 total points
ID: 10734703
Hopefully this is helpful.

<script language="javascript">

 function buttClicked(button, radioChoice, field)
       {


             var hidField = eval("document.test." + field);
             radButton = eval("document.test." + button)
             hidField.value = radButton[radioChoice].value;

       }

 </script>

<form name="test">
 <input type="radio" name="buttonN" id="butt1" value="butt1" onClick="buttClicked('buttonN', '0' ,'hidden1');">
 <input type="radio" name="buttonN" id="butt1" value="butt2" onClick="buttClicked('buttonN', '1' ,'hidden1');">

 <input type="hidden" name="hidden1" value="">

</form>

This will set the value of a hidden field with the value of the button field. If you need something different let me know.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What You Need to Know when Searching for a Webhost Provider
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question