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.

Similar Messages

  • Radion buttons under a radio button.

    Hi-
    I have a selection screen with two radio buttons.
    I have the requirement where when I select the first radio button two other radio buttons under the selected radio button should appear.
    Can anyone help me to acheieve this functionality.
    Thanks.
    Ramesh.

    Take a look at this...
    type-pools: icon.
    data: switch.
    selection-screen begin of block b2 with frame title text-001.
    parameters: radio radiobutton group rnd user-command test default 'X',
                radio2 radiobutton group rnd.
    selection-screen end of block b2.
    selection-screen begin of block b1 with frame title text-001.
    parameters:
               test type bkpf-belnr modif id sc1.
    selection-screen end of block b1.
    selection-screen begin of block b3 with frame title text-001.
    parameters:
               test1 type bkpf-belnr modif id sc2.
    selection-screen end of block b3.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'SC1' AND RADIO EQ 'X'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
        CONTINUE.
      ELSEIF SCREEN-GROUP1 = 'SC2' AND RADIO2 EQ 'X'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
    ENDLOOP.
    start-of-selection.
    Kindly stealed from Rich Heilman -;)
    Greetings,
    Blag.

  • Button using changing Instance Names

    I have multiple button using the same button from my library.
    I have given the all instance name and if I put that instance name
    in from of my addEventListener the button works fine. However, I
    have a lot of buttons on the stage so I want to be able to write
    some thing the will get the instance name on roll over and place
    that in front of the event listener. I am trying to avoid writing a
    line of code for each button. Can this be done?

    you should start here:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/
    go to packages->statements, keywords, & directives
    you can't just ask what a for loop is. it shows you haven't
    done any investigation at all as that is a very basic programming
    construct. you need to learn some basics before you ask people what
    to do. if you have trouble with a particular topic or getting
    something to work, that's what this is for, but it's not to teach
    you the language. there's way too much to learn and too many people
    asking. get a good actionscript book and it will take you through
    the basics.
    i recommend:
    O'reilly Essential Actionscript 3
    good luck

  • Using the radio button component to go to a frame on a MovieClip

    hello,
    I am using the radio button component in Flash with a continue button.
    When the user clicks their option in the radio button and then clicks continue, I want it to go to a movieClips Specific frame.
    Here is the breakdown and the script I have so far is below.
    The radio group os named RadioButtonGroup
    The instance names for each of the three options are noviceButton,intermediateButton,expertButton
    My continue button has an instance name of continueButton
    and my movie clip I am trying to target has an instance name of level_mc
    here is my code so far:
    continueButton.enabled=false
    noviceButton.addEventListener(MouseEvent.CLICK, revealContinue);
    intermediateButton.addEventListener(MouseEvent.CLICK, revealContinue);
    expertButton.addEventListener(MouseEvent.CLICK, revealContinue);
    function revealContinue(evt){
        continueButton.enabled=true;
    continueButton.addEventListener(MouseEvent.CLICK, clickContinue);
    function clickContinue(evt){
    var frameNumber=mc_levels.Number(noviceButton.group.selectedData)
    gotoAndStop (frameNumber);
    the problem starts with my varFrame line-I don't know how to get it to go to the movieClip and gotoAndStop at a specific frame, based on which radio button was clicked and after the continue button is clicked.
    Does anyone out there have any ideas?
    thanks
    babs

    use:
    continueButton.enabled=false
    noviceButton.addEventListener(MouseEvent.CLICK, revealContinue);
    intermediateButton.addEventListener(MouseEvent.CLICK, revealContinue);
    expertButton.addEventListener(MouseEvent.CLICK, revealContinue);
    function revealContinue(evt){
        continueButton.enabled=true;
    continueButton.addEventListener(MouseEvent.CLICK, clickContinue);
    function clickContinue(evt){
    var frameNumber=mc_levels.Number(noviceButton.group.selectedData)
    level_mc.gotoAndStop (frameNumber);

  • How to write a numeric value to a plc register using a radio button

    I'm want display a HOA (HAND/OFF/AUTO) on my screen. Lookout is connected to a Allen Bradley PLC. I am trying to write to a "N" register. I want to write a zero to open all (eg) N7:10 bits, writing a one (1) will close a contact N7:10/0 and writing a two (2) will close N7:10/1 etc. How do I do it? Can I use a radio button and if so, how?

    ICI,
    Just wanted to let you know that you have posted your question in the
    MATRIXx part of the forum.  There is a specific board for
    Lookout.  If you repost your message there you will be more likely
    to get a good answer.
    Carl L
    National Instruments

  • How to use a radio button in enabling/disabling a text box in report progra

    Hi,
        Could any please let me know, how to use a radio button in enabling/disabling a text box in report program.

    *& Report  ZMR_RADIO_BUTTONS
    REPORT  ZMR_RADIO_BUTTONS.
    PARAMETERS : R1  RADIOBUTTON GROUP G1,
                 R2  RADIOBUTTON GROUP G1.
    PARAMETERS : A1 TYPE I,
                 A2 TYPE I.
    AT SELECTION-SCREEN OUTPUT.
    *initialization.
    IF R1 = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 0.
    ENDIF.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 1.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF R2 = 'X'.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 1.
    ENDIF.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
        SCREEN-ACTIVE = 0.
    ENDIF.
    modify screen.
    ENDLOOP.
    ENDIF.
    START-OF-SELECTION.
    *IF R1 = 'X'.
    *LOOP AT SCREEN.
    IF SCREEN-NAME = 'A1'.
       SCREEN-INPUT = 0.
       SCREEN-ACTIVE = 1.
    ENDIF.
    *ENDLOOP.
    *ENDIF.
    *IF R2 = 'X'.
    *LOOP AT SCREEN.
    IF SCREEN-NAME = 'A2'.
       SCREEN-INPUT = 0.
       SCREEN-ACTIVE = 0.
    ENDIF.
    *ENDLOOP.
    *ENDIF.

  • Using Back button issue for radio button

    Dear All,
    My initial screen has 2 radio buttons, on selecting will take to a selection screen with few fields, i have enabled the back button using MODULE user_command AT EXIT-COMMAND.
      when i select a Radio Button 1 which takes to the Selection Screen 1, if the user clicks back button it works fine, even thou we got a mandatory field, it goes back,
    however when i click Radio Button 2 it still takes me to Selection Screen 1, its the same vice versa.
    Is there anyway i can change the screen based on radio button entry

    Hi Krishan,
    You can call your desire selection screen based on the button click.
    if you are working on report program (SE38), then say you have two radio button p1 and p2 and also you have created two selection screen block B1 and B2 and each block has some selection screen elements i.e fields.
    Now if you want that after radio button click b1, you want the only selection screen block B1 and while clicking radio button b2 click ,you want only selection screen block B2.
    Two acheive this in report programming, use the event AT SELECTION-SCREEN OUTPUT.
    so a demo code for the same,
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-049.
    PARAMETERS: p_header RADIOBUTTON GROUP asim USER-COMMAND s DEFAULT 'X',
                                p_item RADIOBUTTON GROUP asim.
    SELECTION-SCREEN END OF BLOCK lim.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-051.
    PARAMETERS : p_vbeln TYPE vbak-vbeln MODIF ID sc1,
                  p_audat TYPE vbak-audat MODIF ID sc1.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-050.
    PARAMETERS : p_vbeln1 TYPE vbap-vbeln MODIF ID sc2,
                                 p_posnr TYPE vbap-posnr MODIF ID sc2.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
       IF p_header EQ 'X'.
         LOOP AT SCREEN.
           IF screen-group1 = 'SC1'.
             screen-active = '1'.
           ELSEIF screen-group1 = 'SC2'.
             screen-active = '0'.
           ENDIF.
           MODIFY SCREEN.
         ENDLOOP.
       ELSEIF p_item EQ 'X'.
         LOOP AT SCREEN.
           IF screen-group1 = 'SC2'.
             screen-active = '1'.
           ELSEIF screen-group1 = 'SC1'.
             screen-active = '0'.
           ENDIF.
           MODIFY SCREEN.
         ENDLOOP.
       ENDIF.
    If you are working with Module POOL, then code in the PAI of the screen, and call your respective screen while respective button click.
    code:
    MODULE user_command_900 INPUT.
         IF p1 EQ 'X'.
              CALL SCREEN 9001.
         ELSEIF p2 EQ 'X'.
              CALL SCREEN 9002.
         ENDIF.
    NOTE: your screen 9001 have some screen input fields and 9002 have some screen input fields.
    Thanks & Regards
    Syed

  • Short cut for Radio buttons (using Ctrl+ key)

    How can I select deselect Radio buttons using Ctrl + keys. I know that setMnemonic can be used to access using Alt + key. But I want to use Ctrl also. Please suggest the solution. How can I select using only single key?

    Read the API for a meaning of each of the arguments. Here is a simple example showing how to assign an "Action" to the Ctrl+1 and Ctrl+2 keys:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class KeyboardAction extends JFrame
        public KeyboardAction()
            JPanel panel = new JPanel();
            setContentPane( panel );
            JTextField textField1 = new JTextField("Ctrl+1 or Ctrl+2", 10);
            panel.add( textField1 );
            JTextField textField2 = new JTextField("Ctrl+2", 10);
            panel.add( textField2 );
            //  Change the input map of the text field,
            //  therefore, Ctrl+1 only works for the first text field
            Action action1 = new SimpleAction("1");
            Object key1 = action1.getValue(Action.NAME);
            KeyStroke ks1 = KeyStroke.getKeyStroke(KeyEvent.VK_1, KeyEvent.CTRL_MASK);
            textField1.getInputMap().put(ks1, key1);
            textField1.getActionMap().put(key1, action1);
            //  Change the input map of the panel
            //  therefore, Ctrl+2 works for both text fields added to the panel
            Action action2 = new SimpleAction("2");
            Object key2 = action2.getValue(Action.NAME);
            KeyStroke ks2 = KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK);
            panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks2, key2);
            panel.getActionMap().put(key2, action2);
        class SimpleAction extends AbstractAction
            public SimpleAction(String name)
                putValue( Action.NAME, "Action " + name );
            public void actionPerformed(ActionEvent e)
                System.out.println( getValue( Action.NAME ) );
        public static void main(String[] args)
            KeyboardAction frame = new KeyboardAction();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setVisible(true);
    }Also, if you search the forum using the keyword "getActionMap", I'm sure you'll find other example.

  • How to set the value of an radio button using set_radio_button_property

    I'd like to set the value of an radio button dynamically, depending of the situation.
    (=> the value which the object returns to the radio group)
    Means: the 'radio button value' of my object 'rb_1' shall be 1, in other circumstances 99 and so on.
    Is it possible to set this value at runtime ?

    the problem is as Gerd wrote:
    there are two or more radio buttons in an option group.
    Their value depends on the text objext t_field.
    If t_field is "car" the value of radio button 1 shall be 75, button 2: 90 and button 3 115.
    if t_field is "bus" the value of radio button 1 shall be 250, button 2: 275 and button 3 300 and so on.
    My problem is to set the value of the radio buttons at runtime after choosing/typing the value of the text field t_field.
    Message was edited by:
    PatrickM

  • How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

    How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?
    I’m creating a form where the user has three options to make a payment.
    1. charge to my credit card
    2. charge associated costs to bank account
    3. By cheque or money order
    My Problem is, under each option, there are required fields that has to be filled out. So if the user picks the first option, charge to my credit card, they would fill out the required fields (credit card number, expiration date etc.). But when they click submit button to submit the form, it won’t let them, because there are required fields under the second option. Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it. So what I'm trying to do is this: If the user selects the radio button for option 1, the other two options are greyed out/disabled. And if the user holds down the shift key and clicks radio button for option one again, it unchecks the radio button and the other two options are available again. Is there a way to grey out or disable the two other payment options when the other one is picked. I’m assuming I will have to use javascript, but what would the coding be and which field do I write it under?
    Thanks in advance guys

    You will have to use custom JavaScript to access the various properties of the field object.
    The radio button group has a value. When no button is selected that value is "Off". When an individual button has been selected the value for the group will be the option or export value for that individual button.
    Once you have determined the button selected, then you will know the form fields that need to be made required. You use JavaScript to access those fields and change the "read only" property to false, and set the "required" property to true. For the fields associated with the other options, those fields should be reset, made read only, and have the "required" property set to false.
    Disabling (graying-out) Form Fields
    >> Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it.
    Radio button in a PDF do not work that way. Only check boxes can be unchecked by clicking on one that has been checked.
    If you plan the coding for the Mouse UP action to test for all possible options and code for each of those options you should have what you want.
    If you want actual code you need to provide a lot more details.
    It is even possible to perform some credit card and bank routing number validations with JavaScript and some check digit formulas.

  • Disable Radio button in a Radio Group

    I have a radio group wiht four radio buttons. I would like to diable one of three radio buttons based on specific condtions. For rdisabling the radio group I use the syntax
    SET_ITEM_PROPERTY('BLOCKNAME.RADIOGROUP',ENABLED,PROPERTY_FALSE);
    Please help me with the syntax to disable only one button from the radio group
    thanks

    BEGIN
         SET_RADIO_BUTTON_PROPERTY('BLOCK3.RADIO','R1',ENABLED,PROPERTY_FALSE);
    END;where BLOCK3.RADIO references your radio group and R1 references the radio button you want to disable :)
    Regards
    Carlos

  • Getting the label from a radio selection in a radio buttons box

    I am using a radio buttons control, with four radio selections in it.  I understand that this is an enumerated type, so the value is a "number."  When you wire that control to a case statement, the case is auto-populated with the labels of the radio selections.  Is there a way to capture the label of the button which was selected?    I am using LabVIEW 8.0 for this project.  Thanks in advance for your time.
    Solved!
    Go to Solution.

    Hi bj,
    just use a FormatIntoString with format specifier "%s"...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Is it possible to display an image instead of button in a radio group?

    I am building an application to be operated with touch screens. I would like to display radio group buttons larger than they are by default. Is it possible to make them seem larger, or to display a custom image instead of the radio group?
    Francisco

    Rather than using a radio group, have you looked into using a list? That is what we use for navigation in APEX in many places when we show large images (like App Builder home page - Run Application, Supporting Objects, Shared Components, Utilities, Export / Import).
    If you need to use radio groups, you can use the template under Globalization to include a larger, clickable image (we do that for pages like selecting the type of page to create). An example template is:
    #DISPLAY_VALUE#<br /><a href="f?p=4000:4700:&SESSION.::::P259_CHOOSE_PAGE_TYPE,P4700_SELECT_REPORT_TYPE:FORM,FORM_ON_A_TABLE"><img src="#IMAGE_PREFIX#menu/wiz_form_140x90.gif" alt="#DISPLAY_VALUE#" class="htmldbGreenIcons" width="140" height="90" /></a>
    Hope it helps -
    -- Sharon

  • Put radio button instead of standard button in user desicion workitem

    Dear Exepert,
    I want to customise my userdesicion workitem,. I want to put radio buttons instead of default button . Please let me know what configuration i need for that.,
    Regards,
    Gurprit Bhatia

    Hello,
    If you are using UWL, it is easy to achieve this through the customization of the xml file.
    Declare the type in the display attribute of a view as type radiobutton, this requires the actionRef.
    The actionRef then specifies the action that the display attribute is linked to. Selection mode SINGLESELECT gives you a radio button so user can move the focus to one work item at a time - this is defined in the view section of the xml file. 
    Here you can see some sample code on how to achieve this through the Universal Worklist:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/7b/1232a8ef574332ba83406f4f5343a3/frameset.htm]
    Best Regards,
    Beth

  • Change Button content when Radio button clicked...

    Within my BSP code I have an OnClientClick event against the Radio button tag.
    What I need to do is to have some kind of Javascript that changes the context (text) or colour of a button if the Radio button is clicked.
    I know very little of how to achieve this and would relish any guidance about how I can get this to work.
    I understand that I need to use a reference/handle to the button and change it's values via javascript, but how can I embed this code into my BSP code, what code do I use, and more importantly how can I obtain this reference/handle on the buttion?.
    Jon

    Hi Jon,
    below an Example to do this
    (due to security forum restriction replace scrip t with script and o nclick with onclick)
    <html>
    <head>
    <scrip t>
    function change_button_text(v_object){
    var button = document.getElementById("id_button");
    var new_text = v_object.value + ' Clicked!';
    if (button.childNodes[0])
            button.childNodes[0].nodeValue=new_text;
        else if (button.value)
            button.value=new_text;
    </scrip t>
    </head>
    <body>
    <form>
    <input type="radio" name="***" value="male" o nclick="change_button_text(this)"/> Male<br />
    <input type="radio" name="***" value="female" o nclick="change_button_text(this)"/> Female
    </form>
    <button id="id_button">Button Text</button>
    </body>
    </html>
    Edited by: alessandro spadoni on Apr 28, 2011 9:56 AM

Maybe you are looking for