Help with radio buttons and show/hide javascript

Hi. I'm new working with LiveCycle and also pretty much at a basic/beginner level of javascripting. I'm creating a pdf fillable form and one of the tasks I've been given is to add a function where if Option A is chosen by the user, then the correspondng table will appear, and if Option B is chosen another table will appear. After some searching I Iearned more about how radio buttons can be used, so I created a set of radio buttons. I have tried several different things, the latest was making both tables "hidden", and then taking to the radio button list group and applying the show/hide script to each of the radio buttons in the group. Still nothing seems to be working as I want it to. The table remains hidden when I click on the . This is what the code looks like right now. I know I'm obviously doing something wrong, this seems like such a basic thing to code. Getting to the frustration point, if you can sort me out with what I am missing/overlooking please let me know. Many thanks!
Note. The radio buttons are not in the same table, they are higher up in the form outside of the tables that I am trying to show/hide, but they are in the same subform. I don't know if that might be an issue?
form1.#subform[0].RadioButtonList::click - (JavaScript, client)
form1.#subform[0].RadioButtonList.#field[0]::click - (JavaScript, client)
   if ( RadioButtonList.#field[0].selectedIndex == 1)
     form1.#subform[0].Table1_Work.presence = "visible"
   else
   form1.#subform[0].Table1_Work.presence = "hidden"
form1.#subform[0].RadioButtonList.#field[1]::click - (JavaScript, client)
   if ( RadioButtonList.#field[1].selectedIndex == 2)
    form1.#subform[0].Table1_Official.presence = "visible"
  else
     form1.#subform[0].Table1_Official.presence = "hidden"

Hi,
For starters you have unnamed pages, which is not a good idea. This makes it more difficult to reference objects. In your JavaScript you would have to resolve the node, however the simpliest route would be to name the page first. Something like "page1". Have a look at this example for referencing objects: http://assure.ly/kUP02y.
Next I would not place the script in each of the radio buttons, as this is likely to cause conflicts and is doubling the script. The best place to put the script is in the click event of the radio button exclusion group. This contains all of the radio buttons. See an example here: http://assure.ly/h7whb8 and https://acrobat.com/#d=ALebgueDXjewHjGyYRdrmw.
You syntax for JavaScript if/else statements is potentially incorrect. The script within the statements should be wrapped in curly brackets. While you can get away with it for single lines, I would not be inclined to take that approach. So:
if (a test) {
     // do something
else {
     // do something else
With the radio button exclusion group you can use its rawValue, just specify it in the Object > Binding palette. So on the basis of chaning the page name:
if (this.rawValue == "1") {
     page1.Table1_Work.presence = "visible";
else {
     page1.Table1_Work.presence = "hidden";
There is a syntax checker button in the Script Editor that should highlight errors.
Niall

Similar Messages

  • How to create popup window with radio buttons and a input field

    Hi Guys,
    Can somebody give some directions to create a stand alone program to create a window popup with 2 radio button and an input field for getting text value. I need to update the text value in a custom table.
    I will call this stand alone program from an user exit. 
    Please give me the guidance how go about it or please give any tutorial you have.
    Thanks,
    Mini

    Hi,
    There are multiple aspects of your requirements. So let's take them one at a time.
    You can achieve it in the report program or you can use a combination of the both along.
    You can create a standalone report program using the ABAP Editor (SE38). In the report program you can call the SAP Module pool program by CALL Screen <screen number>. And then in the module pool program you an create a subscreen and can handle the window popup with 2 radio button and an input field for getting the text.
    For help - Module Pool programs you can search in ABAP Editor with DEMODYNPRO* and you will ge the entire demo code for all dialog related code.
    For Report and other Module pool help you can have a look at the following:
    http://help.sap.com/saphelp_nw70/helpdata/en/47/a1ff9b8d0c0986e10000000a42189c/frameset.htm
    Hope this helps. Let me know if you need any more details.
    Thanks,
    Samantak.

  • Help with Radio Buttons & Combo Box for Flash Form that sends email

    I'm having a bit of a hard time with a Flash form that I'm working on.
    I've got the basic text fields working fine, but I'm not sure how to retrieve the values from the Radio Button and Menu List components.
    The PHP script pulls the values from the text fields with:
    $contact_name = $_POST['name'];
    $contact_email = $_POST['email'];
    $contact_subject = $_POST['subject'];
    but using
    $radioGroup = $_POST['radioGroup'];
    doesn't retrieve the selected radio button value.
    The radio buttons have a groupName of "radioGroup". The combo box component doesn't even show up in the HTML version, but does in the .swf.
    Can anyone point me in the correct direction to pull these values from these components and get them passed to the PHP form? The native .FLA and the php file are here for reference:
    http://dl.getdropbox.com/u/21984/flashform.zip
    My solution needs to be ActionScript 2.
    Thanks!

    again, you assign a variable.  the selected radiobutton's data and/or label isn't going to magically be sent to the php file.
    for example, if you have sendLV and receiveLV loadvars instances, you can use:
    sendLV.rbData=yourradiogroup.selection.data;
    sendLV.yourothervariables=yourothervariables;
    sendLV.sendAndLoad("yourphp.php",receiveLV,"POST");

  • Help me with Radio Buttons and Subform fields, please!

    I've built a dynamic order form with three product options listed as radio buttons. The three options are "Contoured" "Standard" and "Custom". "Contoured" requires five subfields to be filled in if it is selected. "Standard" requires two subfields to be filled in if it is selected. "Custom" has no associated subfields.
    My problem is that I can't figure out a script that isolates the subfields to the appropriate radio buttons. Can anyone suggest a script to use?
    Thanks in advance.
    Brian

    Brian, to understand what I did, I will first explain my hierarchy.
    RBList has 3 radio buttons: A, B, C. Specify the Item Value for each Radio button, e.g. A=1, B=2, C=3. For radio button A, create 2 dropdown lists & 3 numeric fields and wrap in a subform called SubA - ensure you leave it as Visible presence. For radio button B, create 1 dropdown & 1 numeric, wrap in a subform called SubB, and make sure this is visible. I put my code on the subforms (SubA and SubB) rather than the radio buttons. Also, in order for the layout to be saved in Reader, if you want to save and reopen, you must use the script on the Calculate event. The Click event will not save the layout for you (learnt this from past experience in Designer 7.2 Designer 8 saves layout different again). The event Calculates the function as soon as you open up the file.
    Using JavaScript on the Calculate event, on the SubA subform would look like this:
    if (RBList.A.rawValue !=1) {
    this.presence = "hidden";
    else {
    this.presence = "visible";
    Using JavaScript on the Calculate event, on the SubB subform would look like this:
    if (RBList.B.rawValue !=2) {
    this.presence = "hidden";
    else {
    this.presence = "visible";
    The radio button C would not require script if there is not subform needed.
    Let me know if this works for you.

  • Help with Radio Buttons in Form

    Hi. I have inherited a website that has a simple form. I have
    been asked to edit the form adding 4 radio buttons to collect the
    consumer's satisfaction with the content of the website. I have
    added the radio buttons using Dreamweaver MX, however, they do not
    work as I expected them to. I was under the impression that radio
    buttons did not allow the user to select more than one option
    because when the user selected a different option, the first option
    was unselected. My form is currently allowing all four options to
    be selected at the same time. The code for the form is below. I
    have changed the @ in the email address of the form to prevent
    possible spam. Any help would be greatly appreciated.

    It looks like you need to change the name= to the same on
    each radio button, if they all have the same name then you can only
    check one. Then click the form in the behaviors panel and be sure
    the radio button name is inserting into the proper db
    column.

  • Help With Radio Buttons -- URGENT!!

    Hi i am new to using UI compents in flash.
    Basically i havnt a clue where to start.
    Just some simple action script will help and be much
    appreciated if someone can give me it.
    Basically i have a question to ask which requires radio
    buttons to answer the question.
    I have a question and the answers are A, B, C, D.
    I want:
    A to equal 1
    B to equal 2
    C to equal 3
    D to equal 4
    E to equal 5
    Would someone be able to tell me how to set up the radio
    button so that the value of the radio button is stored into an
    array called SCORE.
    i dont need a tutor for arrays, i can do them, i just need
    help with the radio buttons so a reference to an array would be
    enough, eg how to store the answer from the radio button in an
    array.
    Thank you

    Place the radio buttons on the stage and set their parameters
    to what you need. Make sure that for each group of radio buttons
    you give them the same group name. Then you could use something
    like this:
    var listenerObject:Object = new Object();
    var answerArr:Array = new Array();
    listenerObject.click = function(eventObj:Object) {
    answerArr.push(eventObj.target.selectedData);
    trace(answerArr);
    radioGroup.addEventListener("click", listenerObject);
    radioGroup refers to the group name for the buttons.
    eventObj.target will refer to the actual radio button
    clicked.
    Tim

  • Help with radio buttons

    Hi, I am new to forms and and want to create several radio button fields each with two choices, I want the field to be required so that the recipient has to choose either choice 1 or choice 2.
    Problem I am having is that when I set the field to required it sets both choices to required and when testing the form I cannot submit it because one or more required fields are incomplete. Is there a work around or should I be using another type of check box?

    Thank you for your prompt response - I have no experience or knowledge about writing script although from what you wrote this would seem to be the remedy to my problem. For the time being I will have to uncheck the required field option and rely on the recipients completing the form correctly.
    Hopefully over a period of time I will learn how to write the appropriate script.
    Thanks for your help and advice

  • Radio button and  show text

    hello
    i am assigned to create a page (index and action page) where
    the index page has a group of radio buttons ( 4 of them) . if one
    of the four the radio button is selected then a text (paragraph of
    about 30 lines) is shown in the action page after a submitt button
    or next button . can this be done????
    if it can be done how and what is the code for it
    thanks

    display paragraph comes from???
    i dont know yet. would it be better if
    can i just store it on same page where the radio button is
    declared?? then send it to the action page myactionpage.cfm
    this is the example so if a radio button ( a combination of
    radio button it will display in a page)
    what will be displayed for every combination there will be a
    paragraph.
    for example if a radio button bob and camping then i will
    show in the action page (for ex) "BOB had an exciting camping trip"
    if bob and kickback is selected then the message on
    myactionpage.cfm will say in text" bob Kickback and stayed home"
    can this be done.
    if so how
    here is what my example:
    <html>
    <head>
    <title>My sample Page</title>
    </head>
    <body>
    <form name="myform" action="
    http://www.myactionpage.com/
    " method="POST">
    <div align="center"><br>
    <input type="radio" name="group1" value="bob">
    bob<br>
    <input type="radio" name="group1" value="ken" checked>
    ken<br>
    <input type="radio" name="group1" value="Carol"> Carol
    <hr>
    <input type="radio" name="group2" value="camping">
    camping<br>
    <input type="radio" name="group2" value=" riverrafting
    "> riverrafting<br>
    <input type="radio" name="group2" value="kickback"
    checked> kickback<br>
    </div>
    </form>
    </body>
    </html>
    <form name="myform" action=
    http://www.myactionpage.com
    method="POST">
    <div align="center">
    <br><input type="submit"
    value="combinationofradiobuttons!"><br>
    </div>
    </form>
    </body>
    </html>

  • Help with radio buttons in jsp

    I have a form with 6 radio button sets with each set containing three radio buttons. User can select different combination of the radio buttons.. Once the user is finshed selecting the radio buttons I need to pass a message to back end on the selection criteria. The format of the message is to put the same kind of radio buttons in together so say ....
    I have radio buttons like this ...
    N/A Verify NotVerify
    rb rb rb (set 1)
    rb rb rb (set 2)
    rb rb rb (set 3)
    rb rb rb (set 4)
    rb rb rb (set 5)
    rb rb rb (set 6)
    Not if they click verify for 1 and 3 sets and NotVerify for 2,4,6 and N/A for 5 then the String I need to pass to the back end should look like this.....
    ;set2, set4; set6 (set1, set3) i.e group together I type of selection ....
    any ideas how can I do it I will greatly appreciate it.
    Sorry I post it on the wrong message board before
    Thanks

    Okay, let's say you had this HTML code
    <tr>
    <td><radio name="set1" value="na">N/Z</td>
    <td><radio name="set1" value="verify">Verify</td>
    <td><radio name="set1" value="notverify">Not Verify</td>
    </tr>
    <tr>
    <td><radio name="set2" value="na">N/Z</td>
    <td><radio name="set2" value="verify">Verify</td>
    <td><radio name="set2" value="notverify">Not Verify</td>
    </tr>
    ... and so on.
    Why not create 3 vectors, one for each case, and add the necessary string to the vector (or whatever object you need in the backend).
    You could get use request.getParameterNames to get the names of all the sets, loop through that getting the values, and then check to see which it is and add to the vector. I would, thinking about it, use ints instead of strings as the value of the buttons, so you could actually use a switch statement to determine which vector add to. Not saying by any means this is the most effective way, but just one off the top of my head that might lead you in the right direction.

  • Help with menu button and movie load

    Hello everyone....I am very new to flash and actionscripting
    and am self taught using mostly web research.
    I am building a site with a menu and a banner that is
    controlled by the menu (two swf files). I have managed to get them
    to communicate however, I am stuck at this point.
    When "bt_1" is hit I would like a "mv_1" to load in the
    banner.swf with is respected intro animation...this I figured out
    how to do...however now when "bt_2" is clicked I would like play
    the remainder of the animation of "mv_1" to unload the movie before
    "mv_2" loads with its respected enterance animation....this I would
    like to do for several buttons. The method I am using for my local
    connection is this....
    Sending script
    mySender = new LocalConnection();
    on (release) {
    \\ each button has a different param...1,2,3,4,5,6
    _root.mySender.send("menuconnect", "action", 1);
    \\ this is the best way I could figure out to disable the
    appropriate buttons..there might be a better way??
    home.enabled = false;
    couple.enabled = true;
    events.enabled = true;
    bridal.enabled = true;
    media.enabled = true;
    rsvp.enabled = true;
    Recieving script
    myReceiver = new LocalConnection();
    myReceiver.action = function(doThis) {
    if (doThis == 1)
    gotoAndPlay(2);
    if (doThis == 2)
    gotoAndPlay(3);
    //and so and soforth for all six buttons
    myReceiver.connect("menuconnect");
    If all this makes no sense I'm sorry...I tried my best...
    If some pro out there can understand what I'm trying to do
    and can help me I would greatly appreciate it....thank-you all
    sjs

    KGlad...I'm stuck again....:-(. I guess I'm not understanding
    this linkage thing well enought...
    if you don't mind tell me what you had in mind when you
    helped me with that code...this is my situation again....
    here is the actual website....www.beckyandsangeeth.com
    the menu on the left of course has the buttons and I want the
    animation pertaining to each button to load in the apparent banner
    region, (which I am still working on the indivual animations).
    I guess I'm not understanding where the movies are loaded and
    how they are linked...and so and soforth...thanks again
    Also I don't mean to be specifically speaking to
    kGlad...anyone out there I am open for ideas.
    thanks
    sjsamuel

  • Re: Satellite A500 - need some help with FN button and Toshiba programs

    Hi,
    The FN button, Eco button and other specialized buttons such as the one which opens Windows Media Player have stopped responding on my A500 PSAM3A-03P00E which runs Windows Vista. I can still change screen brightness with the FN button but no menu appears at the top of the screen.
    Also the Toshiba programs which are meant to run at start up such as PC Health Monitor are not auto starting, even though they are selected in System Configuration (msconfig).
    Bluetooth manager is however running at start up.
    I have previously had blue screen errors however they are not a problem since I updated the BIOS to 1.5 and uninstalled Zonealarms.
    Cheers

    Thanks all,
    All problems have been fixed after downloads of Toshiba value added package and the new version of PC Health Monitor (V1.3.2.0).

  • Need help with Group Headings and showing them on drill down.

    Hi all:
    I think this is a simple question and feel that I should already know the answer but for some reason it eludes me.  What I would like to know is the proper way to hide/display group headings and have them show up on drill down BUT not repeat on each group header.
    What I have for grouping is as follows:
    Group Header #1 u2013 Sales Rep
      Group Header #2 u2013 Customer
        Group Header #3 u2013 Product Class
          Group Header #4 u2013 Stock Code
            Details
          Group Footer #4 u2013 summary calculated on this line
        Group Footer #3  u2013 summary calculated on this line
      Group Footer #2 u2013 summary calculated on this line
    Group Footer #1 u2013 summary calculated on this line
    My goal is to have my report show only the lines listed below by default and allow the user to drill down group by group to the details section:
    Group Header #1 u2013 Sales Rep
      Group Footer #2 u2013 summary calculated on this line
    Group Footer #1 u2013 summary calculated on this line
    If anyone could offer any help it would be greatly appreciated!
    Thanks,
    FatMan

    click section expert, then for example of GH3, highlight it, then click on the formula box for suppression, and put in the code....
    Drilldowngrouplevel < 3
    The result will be that this GH3 is suppressed whenever the report is showing GH1 and 2 but not 3.
    In addition to this, you must Hide(Drill-down ok) GH3. This is also done in the section expert.
    Then just do the same for GF3, and for GH4/GF4 make sure you use...
    Drilldowngrouplevel < 4

  • Help with email buttons, and uploading from a webpage you created

    Would anyone know how to create a 'contact us' page for a website, so people can send you their contact info and files?
    The GoLive book says your provider does this, but my large hosting provider said you do it in GoLive.
    Most sites have a 'contact us' page, where you can fill in your name and address, and send a PDF or file, just by clicking a 'send' button.
    If someone could help me with this, I'd appreciate it.
    Thank you.

    If your provided provided PHP scripting you can use NateMail from MindPalette (NateMail 3.0.15), and it's free. It's a forms fill-in email contact that can be built in GoLive. I've used it with great success on my site.
    Here is a link to my page:
    http://www.redshift.com/~lorac/Mail/mail.php
    Here's a link to NateMail:
    http://www.mindpalette.com/scripts/index.php#NMAnchor
    Hope this helps.
    Carol

  • Problem with radio button and labels

    Hi Team,
    I have defined the LOV for a form field as STATIC:yes;y,no;n and in 2 columns.
    This is what I get at runtime
    <table>
    <tr><td nowrap="nowrap"><input type="radio" name="p_v07" value="n" id="P18_USED_PRODUCTS_0" />
    <label for="P18_USED_PRODUCTS_0">no</label></td>
    <td nowrap="nowrap"><input type="radio" name="p_v07" value="y" id="P18_USED_PRODUCTS_1" />
    <label for="P18_USED_PRODUCTS_1">yes</label></td>
    </tr>
    </table>
    I want Yes to be the first button. How can I do that? I can with a LOV, but "static" is easier for trivial things like y/n etc.

    Raymond,
    You can use the keyword STATIC2 instead of STATIC to render the options in the order you code them.
    - Scott

  • Help with Radio Group and Web Service

    Hi,
         I created a Radio Group with Dynamic Entry List (Web Service).  It seems my list keeps coming back empty.  I am on SP10. 
         When I deploy I get warnings that "Entry List is missing output fields mapping.  I think this is a warning only because I don't have my form connected to any other components.  I just want to see the radio group populated. I don't think this is the cause. 
    I see references out there to this "Dynamic List" not working until SP12?  Can anyone add some insight to what is wrong?  unsupported until later?
    Thanks!

    I created a new model and the new model works fine.  Something must be cached.

Maybe you are looking for