Solved

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

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

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…

832 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