Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-01
3
Medium Priority
?
200 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 2000 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
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 integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

916 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