Using radio buttons to populate a text field

Hi
This is my first time creating Adobe Forms and my first time using JavaScript as well. One of the questions on my form asks about Ethnicity and I have about 15 choices for which I created radio buttons. I want the user's choice to populate a textfield, but am not sure how to write the code that will do this. Any help would be greatly appreciated. Thanks

If you set the export value (aka Button Value, Radio Button Choice) of each radio button to the text you want to show up in the text box, the custom calculate script for the text box, which you should set to read-only, can be simply:
(function () {
    // Get the value of the radio button group, as a string
    var s = getField("Ethnicity").valueAsString;
    // Set this field's value to the text associated with the selected radio button
    event.value = s === "Off" ? "" : s;
If none of the radio buttons is selected, the text field will be blank. Change "Ethnicity" above to the actial name of the radio button group.

Similar Messages

  • How to use Radio Buttons in SAP BI 7 for a set of three fields?

    Dear SAP Gurus,
    We are using SAP BI 7. We need to use Radio button to select one field name (out of a set of three fields) which
    appeared on selection screen.
    The scenario is; we have three fields
    1) Field Name A
    2) Field Name B
    3) Field Name C
    Now, we need to select one field(using Radio button) from the above and later the report related to the above
    selected field should be displayed.
    The three reports will be as follows:
    1) Report A
    2) Report B
    3) Report C
    if Field Name A  is selected then Report A  will be displayed,
    if Field Name B  is selected then Report B  will be displayed and
    if Field Name C  is selected then Report C  will be displayed.
    To display the report we have two cases;
    1) There will be a common selection screen and all the three reports will come in single workbook but in seperate worksheet.
    2) There will be a common selection screen and all the three reports will come in same worksheet, one after the other.
    Is it possible to create the report in this manner, if yes, please suggest the steps.
    Regards,
    DV.

    I think you would just use commands to do the following:
    1. Hide report Analysis Item 2 and Analysis Item 3 if the 1st button was pushed.
    2. Hide report Analysis Item 1 and Analysis Item 3 if the 2nd button was pushed.
    3. Hide report Analysis Item 1 and Analysis Item 2 if the 3rd button was pushed.
    Hope that helps...

  • Can I populate a text field in one PDF with the modification date of a different file ?

    Rather convoluted problem here but I'm trying to place a text field on a PDF document that serves as the main menu page for a library of interlinked PDF documents
    The complete library contains over 7,000 files and additions are added and documents changed almost daily.
    We currently use batch files to open the main menu from it's shortcut and this runs a check on a sync log file (.txt) to ascertain when the last time the user synchronised with the server to get the latest copy of the files.
    Between a certain time range they are told how long it has been since they sync'ed and are offered the option to sync before opening, after a prescribed timeframe they cannot enter without synchronising. We use Allways Sync to conduct the file synchronisation with our mother files on our server.
    What I'd like to do is take advantage of Allways Syncs automatic synchronisation options to synchronise on log on and at prescribed idle periods there after.
    This works fine but I'd like the text field on the main menu PDF to say when the last synchronisation took place - easy if the main menu is the last file modified .. just use info.modDate.
    However, the main menu is rarely modified therefore I wish to import the text to populate the text field from a different file.. either by interrogating the other files modifictaion data (though I doubt Acrobat can do this) or by simply importing some text stored in another file (a .txt file?) which has previously been created by batch file commands.
    Any assistance would be greatly appreciated.
    Regards,
    Nifty Styles
    (Norfolk, England)
    P.S.  I'm using Acrobat 8.3.1. Professional on Windows XP (SP3).

    Thank you for all your help above.
    Just to confirm your advice, am I right with the following conclusions? :
    1. The script (function) to fill the text field with the modification date of a different PDF file needs to be stored in a folder level .js file.
    2. The document containing the text field needs to call the .js function either within the document script or within the custom script property of the text field itself.
    Further to that can you just advise on the syntax for accessing the modification date of the other document.
    Do I need to assign a variable to the address of the file to be used, and then use this variable in the text form filling script (as below) or can I use a direct file reference at the .modDate command.
    var LastSync = "C:\sync\bin\lastsync.pdf";
    var strMsg = util.printd("h:MM tt",LastSync.modDate) + " on ";
    strMsg += util.printd("dddd, d mmmm, yyyy",LastSync.modDate);
    this.getField("LastSyncDate").value = strMsg;
    If the syntax is totally different to the above I would be very grateful for some guidance in the right direction.
    I much appreciate your time to help me ... I'm almost there.
    Kind Regards,
    Nifty

  • How do I search a site using radio buttons

    I am trying to search a site using radio buttons. I have one table and 5 columns. I have 5 radio buttons marked like 01, 02, 03,04,05. I am using Dreamweaver cs5 php, when I click the radio button 01 I will like to get the response with all 01 files. I will like to mention that the file names are like 01-010-1, 01-010-2 and than 02-020-1 and so fourth I do not know how to write the advance query
    This is what I have
    SELECT QBF, ADDRESS, NATSO, TSOCNT, PDF (this re my db columns)
    FROM alldwgs (this is my table)
    WHERE QBF like %colname% (this is the column that contains the file names 01-010-1 etc)
    ORDER BY QBF ASC
    I don’t know what to write on the variable box
    Name: colname
    Type: text
    Default value: 01
    Run time value: $_GET['QBF']
    I hope that you understand my question I am new to this. Thank you very much for your response

    Thank you for your reply.  I am new to editing a pdf and using these programs. I have subscribed to Acrobat XI Pro.  When I try to edit the document it directs me to LiveCycle.  I cannot move the table in LiveCycle.  It won't let me, and I cannot make changes in XI Pro as I did in the trial as it directs me to edit in LiveCycle.  Am going in circles.

  • Issue in using radio button in module pool

    For same field I need 2 different search help. Based on radio button on screen I need company codeu2019s from different table. Issue is, at execution radio button remains blank. Radio button works only when I use them in PAI under CASE SY-UCOMM. WHEN u2018DONEu2019. IF Normal_Run = u2018Xu2019u2026u2026
    Can I use radio button with the below code. Please refer the below code.
    PROCESS ON VALUE-REQUEST.
    FIELD COMP_CODE MODULE POPULATE_COMP_CODE.
    MODULE POPULATE_COMP_CODE INPUT.
    IF REPEAT_RUN = 'X'.
    PERFORM COMP_CODE_POPULATE.
    ELSEIF NORMAL_RUN = 'X'.
    PERFORM COMP_CODE_POPULATE_N.
    ENDIF.
    ENDMODULE.  
    FORM COMP_CODE_POPULATE .
        SELECT COMP_CODE
          FROM  ZIFRS_D_PROCESS
          INTO  CORRESPONDING FIELDS OF TABLE VALUES_TAB_CC
          WHERE PROC_NAME = 'DEPRECIATION RUN'.
      READ TABLE VALUES_TAB INDEX 1.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD    = 'COMP_CODE'
          DYNPPROG    = PROGNAME
          DYNPNR      = DYNNUM
          DYNPROFIELD = 'COMP_CODE'
          VALUE_ORG   = 'S'
        TABLES
          VALUE_TAB   = VALUES_TAB_CC.
    ENDFORM.                    " COMP_CODE_POPULATION
    FORM COMP_CODE_POPULATE_N .
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          TABNAME     = '/BI0/SCOMP_CODE'
          FIELDNAME   = 'COMP_CODE'
          DYNPPROG    = PROGNAME
          DYNPNR      = DYNNUM
          DYNPROFIELD = 'COMP_CODE'.
    ENDFORM.                    " COMP_CODE_POPULATE_N
    Moderator Message: Please use "code" tags to format the code snippet.
    Edited by: Suhas Saha on Nov 23, 2011 5:13 PM

    Hi
    You need to make the Grouping for these Radio button on the screen
    Search for how to make Radio buttons grouping
    radio buttons in screen painter
    http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCDWBTUT/BCDWBTUT.pdf
    and search for Radio button Group in this document
    assign a Function Code for one of the radio buttons(It allows for only one Radio Button)
    This triggers automatic PAI so when you take the F4 Help this is readily available
    In TOP include make sure you define the variables corresponding to the Radio buttons on the screen and also provide default value X to one of the Radio buttons
    Hope this serves your purpose
    Cheerz
    Ramchander Rao.K

  • Text field properties-Using the 'required' option in the text field properties.

    Using the required' option in the text field properties.
    The 'help' manual describes the 'required' function as this: Required Forces the user to fill in the selected form field. If the user attempts to submit the form while a required field is blank, an error message appears and the empty required form field is highlighted.
    My users ARE not submitting the form, they open the pdf, fill it out and print it. HOW can I, make a field "required', I don't want them to skip/leave blank specific fields. However, if I choose the box 'required' in the text field properties, and I begin filling out the form, I can just tab past that field that I've choose as 'required', and I do not get
    prompt/error message or anything, it allows me to save, or print.
    I WANT SOME TYPE OF message (similar to enter a company order form
    off the web, where you can't continue without filling out 'required' fields).
    Is there a step/option I am not doing?

    Then you are going to have to write some JavaScirpt to be executed by the "Will Print" document action to check all the requried fields, either by name or by the 'required' property and handle the issue of the imcomplete fields. You will not be able to stop the print, but you could display and error field so the user knows the form is incomplete and the printed form also conatains this information.

  • Using Radio Buttons in widget to store Data

    I am building my 2nd widget and I am curious to know if anyone has used radio buttons within the edit mode to change/modify/set variables before. I don't want a radio button widget. I want a complex menu widget that will hide/show selected items within my playbar such as the forward button.
    Currently I am using User variables to determine all the hide/shows for my playbar. But I would like to make it more user friendly by having a visual widget people could use to turn buttons on off, set url's for help documents etc. And have everything be based on a per slide basis. just wondering if anyone has done anything like this in the past.
    The other part of this is, can I use a widget to construct User variables. In As2 I was able to create variables in root and then set those accordingly without having to add them to every projects user variables. But it appears in AS3 it is not possible to create a variable of a clip/objects parent is anyone familiar with this?
    Thanks ahead of time.
    zsrc

    Hi zsrc,
    If you're using WidgetFactory then here's a post that might give you the information that you need.
    http://www.infosemantics.com.au/widgetking/2010/11/widget-properties-how-theyre-used/
    As far as the code you'd write in your circumstance, a radio button's selected property tells you if it's... well... selected. So you can write that to a widget property like so:
    properties.MyPropertyName = myRadioButton.selected;
    That line would be inside the saveProperties template method as mentioned in the article above.
    override protected function saveProperties():void
        properties.MyPropertyName = myRadioButton.selected;
    Then you can read that property back when the widget is in the published Captivate movie.
    override protected function enterRuntime():void
       if (properties.MyPropertyName == true) {
          // The Radio Button was selected. Do stuff
       } else {
          // The Radio Button wasn't selected. Do stuff?

  • How to populate the TEXT field in MIGO

    Hi folks,
    While creating material document in MIGO or MB01, i am inserting some data in TEXT ( Field in line item level ). This text data is disappearing , once mat doc is created.
    how to populate the TEXT field in MIGO?Is there any cusomisation?it's urgent .
    Regards
    pabi

    Hello Pabitra,
    I had a similar issue in my Project.
    Please verify if the SMOD enhancement MBCF0002 (EXIT_SAPMM07M_001) is active in your system.
    If this is the case, verify from two angles:
    a) Whether the Enhancement was accidentally activated - If yes, then De-activate the same
    b) If there is some logic coded in the User Exit, but, the Text is somehow not determined...even the existing content in the text field (input to EXIT_SAPMM07M_001) will get vanished.
    Hope that your problem will be resolved by this.  Pls reward points.
    With Regards
    Vijay Gajavalli

  • How to disable the inputfield using radio button dynamically in module pool

    How to disable the inputfield on the screen using radio button dynamically in module pool.
    Please suggest .
            Thanks.
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:20 PM

    I got it thank you.
    LOOP AT SCREEN.
        if  screen-GROUP1 = 'LA1'.
           If RADIO1 = 'X'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
         ELSEIF RADIO2 = 'X'.
           screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:51 PM

  • How to use Radio buttons in WAD to select different condition in a query

    Hi Guru,
    I am new to WAD, I want to use radio buttons in selection screen of query for different selections based on selection criteria. I am aware of executing different queries using different radio buttons. but i want to use single queries for different radio button selections.
    I have found some relevant topic to it but not got exact solution. Please guide me.

    Hi Avinash,
    Drag a DropDown webitem into your template. Under DropDown webitem properties, Data Binding -> Fixed List of Options.
    Fixed Option -> Action -> Command via Command Wizard, Command -> Commands for Data Providers -> Data Provider Commands for Filter Values -> SET_SELECTION_STATE_SIMPLE. Data Provider Affected -> choose the main DP Query here. Characteristic -> choose Employee Group characteristic here as present in your DP Query. Sign -> INCLUDING, Operator -> EQUAL_SELECTION, Equals -> MEMBER_NAME, Member Name -> specify the value here i.e. Employee1 etc.
    Repeat above Fixed Option step for Employee2, Employee3 etc. selections. For 'All' option choose Command CLEAR_SELECTION_STATE with Data Provider Affected as the main DP Query & Characteristic as Employee Group.
    --Priya

  • Related selects using radio button

    Hi All,
    I wanna use radio button with three options and one dropdown
    box .
    my problem is i wanna choose option from radio button and run
    the related query to get the values into dropdown box and then
    choose the value from drop down and submit it to another page.
    Any ideas ? please help me.
    Thanks in advance

    Google coldfusion related selects and adjust the javascript
    so that you are using radio buttons instead of a select.
    I recently posted my own code. Look for the keyword
    etiologydetail.

  • Using radio buttons to set the value of a text field

    I have a set of three radio buttons on a form (a performance evaluation). If I select the "1" button, I want 1 to populate in the text field. The same goes for "2" and "3"
    I have not been able to code the buttons correctly for this scenario, and can't figure out how to do it.
    From a previous post, I was able to get check boxes to do what I want, but they won't really work because I can't set them so that only one back may be selected.
    Can this be done?
    Thanks!

    The information for this specific case isn't anywhere. The best that you can do is understand what triggers each of the events, then ask yourself which of those triggers are pertinent to your current issue.
    http://help.adobe.com/en_US/livecycle/es/LiveCycle_Designer_Scripting_Basics.pdf ...
    The above link contains a great deal of information regarding how to use scripts within Livecycle Designer. The section that you would be most interested in in order to learn about the available events can be found under "Events >> List of Events".
    You needed to use the initialize event so that the text field would be updated when the document was opened. This ensure that the text field has the value of the default radio button when it is opened for the first time.
    You needed to use the change event so that, when the use selects a different radio button, the text field is updated with the new value.
    That's about it. That PDF file that I link to above is a bit long, but it's a great place to get a good grasp of the basics of scripts.
    If you have any further questions, feel free to ask. =) Have a good one.
    - Scott

  • Using radio button instead of text field

    Hi. I need to convert a text field for radio button. The conversion is as follows: the user will choose one of three options on the radio button (gif, png and jpeg). If the user chooses the image format such as jpeg, for example, how should I put in value? Put image/jpeg and does not work. This text field belongs to a form that was generated automatically by a WebService Data Control. Thanks

    remove the text field.
    drag and drop that attribute from data control, choose selectOneRadio
    in the wizard window, select fixed list and select this particular attribute and then type gif, png and jpeg one by one.
    in the pagedef it would be something like below:
        <list IterBinding="myIterator0" id="image" DTSupportsMRU="false"
              StaticList="true">
          <AttrNames>
            <Item Value="image"/>
          </AttrNames>
          <ValueList>
            <Item Value="gif"/>
            <Item Value="png"/>
            <Item Value="jpeg"/>
          </ValueList>
        </list>whatever you select that values goes to db.

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • Auto populate blank text fields with n.a from a button or on print out.

    This seems straight forward but I cannot find an existing questions on this topic.
    I would like to add a form function that will fill any blank text fields with n.a. I do not want to use the default field value as I think it will cause confusion and cannot be applied for text fields formatted for dates. Is it possible to run a script that can do this? It would be OK if the action was triggered from a button or print activity after the rest of the form has been completed.
    Any thoughts would be appreciated.
    Thanks

    The question is whether your form is used only for filling out on screen (and not as a level 0 form, being printed out and filled out manually).
    If so, why not make the default value of the concerned fields to be "n/a" (or whatever you want to name them). That would relieve you from any validating before printing.
    Otherwise, you could maintain a list of field names which should get the n/a value if empty. This list would be an array.
    Your code in the willPrint event (if you want to have it reliably) would then look like this:
    for (var i = 0 ; i < nafieldarray.length ; i++) {
    if (this.getField(nafieldarray[i]).value == this.getField(nafieldarray[i]).defaultValue) {
    this.getField(nafieldarray[i].value = "n/a") ;
    HTH.
    Max Wyss.

Maybe you are looking for

  • IPhoto 9.6 Yosemite asks to do upgrade and then permissions repair

    After the Yosemite upgrade, iPhoto was updated and was all running fine. Could access photos etc.  iPhoto previous version was the Mavericks one, so not v7 or before, requiring the Library upgrade tool. Last night when trying to access iPhoto, it com

  • *** Turning the "conforming HDV video" render OFF

    I had to print some HDV projects back to tape, so on the advice of another person here, changed some settings so that the "conforming HDV video" stage was done before deciding to print the sequence to tape. I'm finished printing my projects to tape n

  • When I delete music from my iphone, it's just synced back when I connect to itunes

    I'm running out of space on my iphone. So when I delete songs directly on my iphone to free up space, they are just synced back again when I connect my iphone to itunes. Doesn't this kind of defeat the purpose of being able to delete music on your ip

  • Capture suddenly not available

    I have been using sql developer for over a month now to move data from a mysql database to an oracle10 db. This afternoon the capture option (right click on a specific table) is greyed out/unavailable (it was working this morning). I didn't make any

  • SATA Raptor HD in a Quicksilver 2002

    The speed and reported reliability of the WD Raptor is hard to beat. Since installation in G4 requires a PCI adapter card and the PCI slots are only 33MHz, would a Raptor actually be able to shine in my quicksilver in terms of speed... drive reliabil