Solved

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

Posted on 2004-04-01
3
191 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
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…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

810 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