Using a dropdown to set a radio button
I've been searching and searching in vain, trying many different things can I cannot seem to find an answer already or stumble on similar code to help.
I've got a dropdown, then when you select different values set different fields on the form. That part works fine stuff like this in the custom validate:
if (event.value == "Thing1") {
this.getField("DESC01").value = "Words that fill in a desciption box.";
this.getField("DESC02").value = "More words that fill in another descrption box";
this.getField("F_SKILL1").value = "1";
this.getField("RB_SKILL1").isBoxChecked(1);
this.getField("F_SKILL2").value = "1";
this.getField("F_SKILL3").value = "1";
} else if (event.value == "Thing2") {
this.getField("DESC01").value = "Different words that fill in a desciption box.";
this.getField("DESC02").value = "More different words that fill in another descrption box";
this.getField("F_SKILL4").value = "1";
this.getField("RB_SKILL1").isBoxChecked(0);
this.getField("F_SKILL5").value = "1";
this.getField("F_SKILL6").value = "1";
etc, etc. I've got a few different else ifs but they all follow this kind of format. There is are also radio button next to the skills on the sheet to visually display that skill is known. So I'd like to turn that radio button on. My isBoxChecked isn't working, and I expect that's because it doesn't work that way. I have a lot of radio buttons on the form, but they all have 1 choice in them none are groups. Again, I'm using this as a visual display that SKILLX is known. The area I've dropped the radio button onto the sheet is a very small circle which is why I am trying to use a radio button as it's visually similar.
If there is a better solution to what I'm trying to do I'm happy to try that, or if someone can tell me what I'm doing wrong that'd be super
Thanks!
Not quite sure I'm getting what you are laying down...
So in the dropbox, under options I should set the export value of Thing1 choice to RB_SKILL1 and then in my validate I should include this.getField("RB_SKILL1").value = 'Yes' ?
Or I should just set the export value of Thing1 to this.getField?
Thanks
Oh, using a check box I was able to get this working using the export values set for Thing1 option, most excellent! Thank you very much!
Similar Messages
-
Set of Radio Buttons in a page
Hi,
I am new to OAF. My use case is to create a page with set of 'Yes/No' questionnaires. So, there will be set of radio buttons associated with each questions.
Please guide me to achieve this in OAF.Hi,
You can create the radio button in processRequest by using (OAMessageRadioButtonBean)webBean.createbean()
Also, check if this link can help u : http://oracleanil.blogspot.in/2009/04/radio-group-event.html
--Sushant -
Disable a set of radio buttons
Hello Experts,
I have written a code in which there are two set of radio buttons.
In first set there are three radio buttons.
p_range RADIOBUTTON GROUP rbg DEFAULT 'X',
p_date RADIOBUTTON GROUP rbg,
p_comp RADIOBUTTON GROUP rbg.
In second set there are 10 radio buttons.
I need to write a code in a way that if user selects the third radio button from first set p_comp, then few of the radio buttons from the second set should grey out.
Please help me with some sample code.
Would definately reward if the code is useful.Alternatively you can also use MODIF ID's for the radio buttons to do the same.
You can get the syntax on the F1 help...
Cheers,
Tatvagna.
Eg.
p_1 RADIOBUTTON GROUP rb2 DEFAULT 'X' modif id r1,
p_2 RADIOBUTTON GROUP rb2 modif id r1,
p_3 RADIOBUTTON GROUP rb2 modif id r1,
p_4 RADIOBUTTON GROUP rb2 modif id r3,
p_5 RADIOBUTTON GROUP rb2 modif id r1,
p_6 RADIOBUTTON GROUP rb2 modif id r1,
p_7 RADIOBUTTON GROUP rb2 modif id r2,
p_8 RADIOBUTTON GROUP rb2 modif id r2,
p_9 RADIOBUTTON GROUP rb2 modif id r2,
p_10 RADIOBUTTON GROUP rb2 modif id r1.
And then do
Loop at screen.
IF screen-group1 IS NOT INITIAL AND
NOT screen-group1 EQ 'R1' .
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
endloop. -
2 sets of Radio Buttons in a Form-complications
Hello everyone,
I have been looking around for code to assist me in building a form. I have developed the form, and just have a couple problems that I can't figure out.
In one question on the form the user can choose from one set of radio buttons and select one of the five options. Then I have a second set of radio buttons, that the user can again only choose one option. My problem is that I only want the user to be able to select from the second set of radio buttons if they selected a certain option in the first set. An example to clear up my problem:
Did you finish the training:
Yes
Half
None
So if the user selected yes from the first set of radio buttons, I want the second set of radio buttons to now be selectable:
The training was:
Up-beat and enjoyable
Snoozer
The conditions that I am using are very different than these but this is just a simple skit. So how do I make the second set of radio buttons unselectable until the user selects a specific radio button from the first set of radio buttons.
Thanks, I really appreciate the help!If you have a radio button exclusion group called 'completion' with three items 'Yes','Half', and 'None' and a second radio button exclusion group called 'completion', go to the 'feedback' Value tab and set the type to 'readOnly'.
Add the following script to the 'completion' change event...
// form1.page1.subform1.completion::change - (JavaScript, client)
if (this.rawValue == "Yes") {
form1.page1.subform1.feedback.access = "";
else {
form1.page1.subform1.feedback.access = "readOnly";
form1.page1.subform1.feedback.rawValue = "";
If the user selects 'Yes', the 'feedback' group is available for selection. If the user does not select 'Yes', 'feedback' is reset and made readOnly.
Steve -
Sets of Radio buttons all grouped together
I am creating a form with many sets of radio buttons. Each set contains 3 buttons. When I add the 4th button, Designer groups it with the first three. When I add a 5th button, it is automatically grouped with the first 4. I need to separate the buttons into groups of 3. How do I manually choose which radio buttons to group together?
EricDoing this is little tricky... Add all your radio buttons and then choose all the ones you want to group in a different set holding Ctrl key. And then click your mouse button (right). Then choose 'Wrap in New Radio Button Group'.
Good luck,
SekharN. -
Setting a Radio Button value using Javascript
After much research, I've figured out that the appropriate command to get the value of a Radio Button in APEX JavaScript is "html_RadioValue", but I haven't been able to figure out a command that will let you set the value of the Radio Button. Is there documentation on APEX's use of JavaScript that covers this issue?
Here's a simplified version of the script:
<script language="JavaScript" type="text/javascript">
function showval()
var item1 = html_RadioValue('P19_RADIO');
alert(item1);
//Reverse the current selection
if (item1 == 'Y') then
<mystery_statement> //set P19_RADIO to N.
else
<mystery_statement> //set P19_RADIO to Y.
</script>
I've tried the following, but none of them have worked:
- document.getElementById("P19_RADIO").value = 'N';
- document.getElementById("P19_RADIO").checked = 'N';
- $x('P19_RADIO').value = 'N';
- $x('P19_RADIO').checked = 'N';
Thanks.Okay, that worked in the Oracle-hosted environment, but not in my development environment. Looking at the view/source output from each, it seems that the versions of APEX are different - my environment is using version 3.0.1.00.07.
The most obvious difference between the sources is the javascript includes at the top:
<script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script>
<script src="/i/javascript/apex_3_1.js" type="text/javascript"></script>
<script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script>
<script src="/i/javascript/apex_builder.js" type="text/javascript"></script>
vs.
<script src="/i301/javascript/htmldb_html_elements.js" type="text/javascript"></script>
<script src="/i301/javascript/htmldb_get.js" type="text/javascript"></script>
My fundamental question is: how does one learn Javascript, in the context of APEX? I can't find any documentation that explains what $v means, or what $x means, or what $s means.
Thanks. -
How can I set a radio button to a be checked using an action script?
Acobat X: I have two radio buttons called EnrollmentType with different values. "New Student" and "Returning Student". I need to set 160 forms to returning student, Please
will this work?
getField("EnrollmentType").value = "Returning Student"This is Adobe X Pro:
Ok when I click the properties of the radio button. Both have the same
"Enrollment type".
But each has a different "Radio Button Choice" under the Options TAB.
It does work when I process the forms and save the data.
The field "Enrollment type" contains either "New Student" or "Returning
Student" depending on which option they picked.
I am sending these forms back to the parents to edit any new/changed info
and want it to have "Returning Student" checked since they are in fact
returning and not new anymore. -
How to Use Switch Statement with Exclusion Group (radio buttons)?
Wouldn't you know, just when I though I'd really be making progress, I've come across another problem I can't solve. In a homeowners insurance application I am building, there is an exclusion group that needs to set the value of several variables
I have setup in the form properties/variables. These variables take on different values depending on the users choice. For the exclusion group, in the object pallet, I have set the binding to normal, and have checked the "Specify Item Values" check box. Also the values for the choices have been assigned 1,2,3,4,5.
Here is my code for the change event fir the exclusion group (This is exactly what I have tried). For now, the values for the variables to take on in the different cases, are completely arbitrary.
switch (this.change.rawValue) // I have tried so many things here
case "1": // I have tried the caption, single quotes in all combinations
addLivingExp = "1";
damageOthersProperty = "2";
liabilityIncl = "3";
maxCoverage = "4";
minCoverage = "5";
persProperty = "6";
relatedPrivateStruct = "7";
break;
case "2":
addLivingExp = "10";
damageOthersProperty = "20";
liabilityIncl = "30";
maxCoverage = "40";
minCoverage = "50";
persProperty = "60"
relatedPrivateStruct = "70";
break;
case "3":
addLivingExp = "100";
damageOthersProperty = "200";
liabilityIncl = "300";
maxCoverage = "400";
minCoverage = "500";
persProperty = "600"
relatedPrivateStruct = "700";
break;
case "4":
addLivingExp = "1000";
damageOthersProperty = "2000";
liabilityIncl = "3000";
maxCoverage = "4000";
minCoverage = "5000";
persProperty = "6000"
relatedPrivateStruct = "7000";
break;
case "5":
addLivingExp = "10000";
damageOthersProperty = "20000";
liabilityIncl = "30000";
maxCoverage = "40000";
minCoverage = "50000";
persProperty = "60000"
relatedPrivateStruct = "70000";
break;
default:
minCoverage= 5;
break;
There must be something obvious I am missing? Eternally grateful for advice on this.
StephenThere are two issues in this script:
1. You are not using the accessor 'value' to set form variables
2. You are not correctly getting the value of the radio button list in the switch clause
Please see the working script below.
Ben Walsh
www.avoka.com
switch (this.rawValue)
case "1":
addLivingExp.value = "1";
damageOthersProperty.value = "2";
liabilityIncl.value = "3";
maxCoverage.value = "4";
minCoverage.value = "5";
persProperty.value = "6";
relatedPrivateStruct.value = "7";
break;
case "2":
addLivingExp.value = "10";
damageOthersProperty.value = "20";
liabilityIncl.value = "30";
maxCoverage.value = "40";
minCoverage.value = "50";
persProperty.value = "60"
relatedPrivateStruct.value = "70";
break;
case "3":
addLivingExp.value = "100";
damageOthersProperty.value = "200";
liabilityIncl.value = "300";
maxCoverage.value = "400";
minCoverage.value = "500";
persProperty.value = "600"
relatedPrivateStruct.value = "700";
break;
case "4":
addLivingExp.value = "1000";
damageOthersProperty.value = "2000";
liabilityIncl.value = "3000";
maxCoverage.value = "4000";
minCoverage.value = "5000";
persProperty.value = "6000"
relatedPrivateStruct.value = "7000";
break;
case "5":
addLivingExp.value = "10000";
damageOthersProperty.value = "20000";
liabilityIncl.value = "30000";
maxCoverage.value = "40000";
minCoverage.value = "50000";
persProperty.value = "60000"
relatedPrivateStruct.value = "70000";
break;
default:
minCoverage.value = 5;
break; -
Multiple sets of radio buttons no longer working
Hello All:
My first post so I apologize in advance if I don't do it
properly.
I have a few web forms that have multiple groups of radio
buttons on them that are suddenly errorring out since we moved to
CF 7. I started tinkering with the one form that I have posted the
code for and kept cutting it down to the simplest code that begins
to produce the error. If I just use 1 radio button group everything
works fine, but the minute I add the second one, the whole thing
throws a "Syntax error (missing operator) in query expression"
message. Each radio button group has it's own group name and a
checked value. It is very simple code and very frustrating why it
has suddenly stopped working so any assistance is welcome.
Here's the form code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body background="white" marginheight="0"
marginwidth="0">
<cfform action="testSub.cfm" method="POST">
<table width="95%" border="0" cellpadding="0">
<tr>
<td width="24%"><img src="survey.jpg"
border="0"></td>
<td width="76%"><p>It is our desire to assure
that MID is meeting the needs of
our clients. xxxxxxx
<p> </p>
<p>*****************************************************<br>
</p></td>
</tr>
<tr>
<td colspan="2"><p>Please answer questions 1
through 4 with a 1 - 5 rating, with 1 being POOR and 5 being
EXCELLENT.</p>
<p> You are not obligated to provide this
information.</p>
<p><font face="Arial, Helvetica, sans-serif"
size="2">My Name (First &
Last):</font> <font face="Arial, Helvetica,
sans-serif" size="2">
<cfinput type="Text" name="poc" required="no" size="50"
maxlength="50">
<br>
<b>1. Was
your service technician polite and
courteous?</b><br>
<cfinput type="radio" name="polite" value="1">
1
<cfinput type="radio" name="polite" value="2">
2
<cfinput type="radio" name="polite" value="3" checked>
3
<cfinput type="radio" name="polite" value="4">
4
<cfinput type="radio" name="polite" value="5">
5 </p>
<p><br>
<br>
2. Was
your service technician polite and
courteous?</b><br>
<cfinput type="radio" name="know" value="1">
1
<cfinput type="radio" name="know" value="2">
2
<cfinput type="radio" name="know" value="3" checked>
3
<cfinput type="radio" name="know" value="4">
4
<cfinput type="radio" name="know" value="5">
5 </p>
<input type="submit" name="btnSubmit" value="Submit My
Comments!">
<input type="reset" name="reset" value="Reset
Form"><br>
<br>
</cfform>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
The ACTION code
<html>
<head>
<title>test</title>
</head>
<body>
<CFIF IsDefined("FORM.btnSubmit")>
<CFQUERY NAME="Add" datasource="newMID">
INSERT INTO survey(
poc,
polite,
know
VALUES (
'#poc#',
'#polite#'
'#know#',
</CFQUERY>
</CFIF>
<cfoutput>
Thank you. Your IT survey has been forwarded to our NHCPR IT
mailbox.
</cfoutput>
<cfmail to="[email protected]"
FROM="[email protected]"
SUBJECT="IT Survey Form">
Polite: #polite#
Know: #know#
POC (opt.): #poc#
</cfmail>
</body>
</html>OK. I took out the extra comma. Put a space in after *survey*
and put "form" in front of the variables in order to scope them. I
got it to work just then and decided to add the next radio button
and once again, the error message keeps coming up.
Here's what it looks like now.
ACTION
code***********************************************************
<html>
<head>
<title>test</title>
</head>
<body>
<CFIF IsDefined("FORM.btnSubmit")>
<CFQUERY NAME="Add" datasource="newMID">
INSERT INTO survey (
poc,
polite,
know,
time
VALUES (
'#form.poc#',
'#form.polite#',
'#form.know#',
'#form.time#'
</CFQUERY>
</CFIF>
<cfoutput>
Thank you. Your IT survey has been forwarded to our NHCPR IT
mailbox.
</cfoutput>
<cfmail to="[email protected]"
FROM="[email protected]"
SUBJECT="IT Survey Form">
Polite: #polite#
Know: #know#
POC (opt.): #poc#
Timely: #time#
</cfmail>
</body>
</html>
The ERROR msg
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.
The error occurred in
C:\Inetpub\wwwroot\PaxNew\chiefOscar\testSub.cfm: line 20
18 : '#form.polite#',
19 : '#form.know#',
20 : '#form.time#'
21 : )
22 :
SQL INSERT INTO survey ( poc, polite, know, time ) VALUES (
'kennedi', '3', '5', '3' )
DATASOURCE newMID
VENDORERRORCODE -3502
SQLSTATE 42000
Resources:
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Remote Address 10.249.6.81
Referrer
http://205.115.107.22/chiefoscar/tsurvey.cfm
Date/Time 29-Jan-08 02:05 PM
Stack Trace (click to expand) -
How to set a radio button to be selected?
I'm trying to find out how to do something that should be seemingly simple. That is to create a little function that selects a random radio button as selected. I have 3 radio buttons in a group (see code):
</mx:ApplicationControlBar>
<mx:RadioButtonGroup id="radiogroupZ"/>
<mx:RadioButton x="10" y="608" label="Button 1" groupName="radiogroupZ"/>
<mx:RadioButton x="10" y="634" label="Button 2" groupName="radiogroupZ"/>
<mx:RadioButton x="10" y="660" label="Button 3" groupName="radiogroupZ"/>
I've tried all kinds of code to try to set Button 1, 2 or 3 as selected but the compiler keeps giving me errors.
Can someone give me an example of a simple function that will set one of these as highlighted? All I need is the code that basically says for example: "Select Button 1 in the group "radiogroupZ to be selected".
Thanks// This will have the first button selected.
<mx:RadioButtonGroupd id="radiogroupZ" selectedValue="somethingHere1"/>
<mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere1" groupName="radioGroupZ"/>
<mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere2" groupName="radioGroupZ"/>
<mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere3" groupName="radioGroupZ"/>
// To select something in a function
private function functionName():void
radiogroupZ.selectedValue = "somethingHere1"; -
How to set / reset radio buttons in screen..
hi,
i have 4 radio buttons in my screen, initially only the first one must be active and all other must not be in selected state. at any point of time only one must be selected and based on the selection the subscreen area must be filled with the subscreen.
whats the code to check if the radio button is selected or how to set the action for the radio button selection ?
also whats the statement to reset the radio button ?
thksYou put them all in a radiobutton group.
For example:
PARAMETERS: rb_pres RADIOBUTTON GROUP rbf,"Presentation Server Files
rb_app RADIOBUTTON GROUP rbf."Application Server Files
The first one is defaulted to "X", but you can also do that yourself.
You check the value = "X" to see which is selected or say IS NOT INITIAL.
Hope this helps,
Mark -
I need to create several different sets of radio buttons within one document.
How do I designate a group of radio buttons. When I export my file as it is now, all of the radio buttons in my file are in just one group, which is not accurate.
Thank youThank you. As it turns out I had done it correctly, the style was just so, that the radio button was hard to distinguish if it had been clicked or not. When I zoomed in there was a slight dot in the center of the radio button to designate that it was actually selected.
Thank you again. -
How to set radio button from radio group using javascript, HTMLB
Hi guys,
I am trying to set one radio button as checked, from my radio button group using javascript.
This is the code:
<hbj:radioButtonGroup id='TRAIN_SUB' columnCount="1">
<hbj:radioButton id="TRAIN_SUB0" text="Not Applicable" key="NA" disabled="true" />
<hbj:radioButton id="TRAIN_SUB1" text="SDF" key="SDF" disabled="true" jsObjectNeeded="TRUE"/>
<%
ssTrainSubsidy = new String(MAIN_FORM.getParamIdForComponent(TRAIN_SUB));
%>
</hbj:radioButtonGroup>
in javascript, i am using this:
/document.getElementById('<%= ssTrainSubsidy%>')[2].checked =true;
I also tried to access the radiobutton directly, using
ssTrainSubsidy0 = new String(MAIN_FORM.getParamIdForComponent(TRAIN_SUB0));
but it has null pointer error.
but always have error, anyone can help? thanks!!
Edited by: Feng Guo on Aug 12, 2010 3:44 PMdocument.getElementById(radioid).checked =true;
this code will work to select the radio button (set). i think there is a error in the id you placed in ID. place the Radio butoon id and check again. Check this thread on [setting a Radio button|Setting HTMLB RadioButtonGroup Selection using JS;
regards,
Mahesh -
Autofill a radio button using other radio buttons
I would like a question on my form "Q24 Decrease Smoke" (set of "Yes"/"No" radio buttons) to auto fill with a response of "No" if the user selects "Not at all" to 3 other questions (also sets of radio buttons). If the user selects any other response to any of these 3 questions, I want the user to be able to manually select either "Yes" or "No". This is the code that I've tried, under the Mouse Up event of the "No" radio button option for Q24:
var a = getField("Q20 Smoke Cig").value;
var b = getField("Q22 Smoke other forms").value;
var c = getField("Q23 chew/snuff").value;
if(a=="Not at all" && b=="Not at all" && c=="Not at all") event.value = "On";
I'm new to Javascript, so am not entirely sure I am on the right track or what might be wrong here. Any help would be greatly appreciated. Thanks!Have you tried to the set the value to to "No"?
The "Mouse Up" action only works when there is a "Mouse Up" action for the field.
I would look at using the script in the 'On Blur" action for the 3 fields with adjustments for the fields as needed for the field where the script is used. -
Hi,
I own a Linksys-Router WRT54G v7.0 with firmware v7.00.8 build 008, Jul. 9, 2009.
On the web GUI (Setup/Basic Setup) there's a setting "Keep Alive: Redial Period XX Sec.". As I'd like to stay connected with my provider permanently, I've set the radio button to "Keep Alive: Redial Period" and the according text field to "30" seconds. Then, I've clicked "Save Settings" and got a confirmation message that the settings got saved.
Anyway, even after saving the settings the according radio button is still set to "Connect on Demand...". But that is only true for newer browsers, like e.g. IE8, IE7 or Firefox 8. If you use an older browser, like e.g. IE6, then the radio button is correctly set to "Keep Alive: Redial Period" with a value of "30" seconds.
Conclusion: The settings get correctly saved by the router (I can confirm that), but they don't get correctly shown in the web GUI. Looks like a HTML/Javascript bug in the router's admin web GUI. That's really annoying as you never exactly know the effective settings...
Can someone confirm that bug? Is there a newer firmware than version 7.00.8?
Regards,
PatrickTry to clear the browser's cache as well.
"Don't fix it if it ain't broken."
Maybe you are looking for
-
I am new to the bdc . i have gone to SHDB and created a new recording for the some T-code . After that i have created a prog (transfer from recording ) . i got some values in the file in my presenation server. i got default code generated . I have t
-
I've just upgraded from iTunes 7 to 8 without any problems but I installed a program called TuneUp (attaches itself to iTunes) that will help you find cover art etc. that iTunes can't. TuneUp says if you're having any problems with their software wor
-
User exit which changes po (item level) delievery date (eket-eindt)
Hi, Can you please suggest EXIT which triggers while changing delivery date (LIKP-LFDAT) of outbound delivery through TCODE VL02N should reflect in its corresponding purchase order delivery date ( ME22N at item level field (EKET-EINDT).. I tried in
-
Why won't certain texts go through?
I have one number in my contact list that keeps getting the red exclamation mark every time I text it. They used to go through and now they don't. Anyone know why?
-
Retrieving the currently logged in username
As I'm just starting playing with C3POs, is there an easy way to retrieve the currently logged in username? I'm wanting to open up a webpage and pass it the username as a parameter. Any suggestions? Thanks!