If the else with Radio button statement

I try to make a PDF form for customers to order event services. I have a field I want to fill it with a number based on their choice of upgrade that is defined as radio buttons. If they choose option 1 or 2, the upgrade price is X. If they choose option 3 or 4, the upgrade price is Y. I want the text box to display X or Y depending on their choice. Or just 0 if they choose to not upgrade.

JavaScript is quite far from my knowledge base, but I try to understand it anyway. Any help? What I have below (and everything else I've tried) does not work.

If {(btn1.checked)

162 = Event.Value;

} Else if (btn2.checked) {}

182 = Event.Value;

} Else if (btn3.checked) {}

162 = Event.Value;

} Else if (btn4.checked) {}

182 = Event.Value;

}

Then you can use something like this as a custom text field calculation script:

Event.Value = "";

var v = this.getField("menu").value;

If (v == 'opt1': v == 'opt2') {}

162 = Event.Value;

} else if (v == 'opt3': v == 'opt4') {}

182 = Event.Value;

}

Tags: Acrobat

Similar Questions

  • I want to build a form with radio buttons to customers limited checking all the options.

    I want to build a form with radio buttons to customers limited checking all the options. I have a range of products and to quote accurately, I want to get specific information.

    If I get this, what you want to display the shape options to specific customers, not to all the viewers of the site?

    You must create a secure area where authorized viewers can connect and view the form with all the options, form itself we can not set up since what few customers are going to see other options and others are going to see another.

    This is possible since the end of your accommodation. Or if you are using Adobe server for hosting, then you can create profiles for clients and then set up another form altogether to achieve this goal.

    Thank you

    Sanjit

  • Dialogue with radio buttons

    Honourable experts,

    I'm on Win7 64 bit, CS6 (ID 8.1.0.420).

    Script of skills - somewhere in the "Very basic" level

    Now try to adopt, my needs, a dialog box with radio buttons, as in Script UI v2-2 Peter Kahrel, pdf, page 17:

    var w = new Window ("dialog");
    var radio_group = w.add ("panel");
    radio_group.alignChildren = "left";
    radio_group.add ("radiobutton", undefined, "InDesign");
    radio_group.add ("radiobutton", undefined, "PDF");
    radio_group.add ("radiobutton", undefined, "IDML");
    radio_group.add ("radiobutton", undefined, "Text");
    w.add ("button", undefined, "OK");
    // set dialog defaults
    radio_group.children[0].value = true;
    function selected_rbutton (rbuttons)
    {
    for (var i = 0; i < rbuttons.children.length; i++)
    if (rbuttons.children[i].value == true)
    return rbuttons.children[i].text;
    }
    if (w.show () == 1)
    alert ("You picked " + selected_rbutton (radio_group))
    

    My version is designed for operation on the text selected (with the text tool). And here's the problem.

    After selecting the text with Ctrl + A, or shift + end or Ctrl + Shift + end - then - hit KB shortcut assigned to the script I usually 'loose' the mouse pointer. It is still there, but turns out is invisible on the entire InDesign window. "Usually" means approximately 5-6, 10 times... Who escapes from the script window and still hit the shortcut script works - next try mouse pointer remains visible. Until you select another part of the text...

    If the text has been selected with the mouse - or - script is invoked by double-clicking its name in the actions palette, everything goes well, always. Also works well with other types of selection.

    Changing shortcut KB has no effect.

    Replace a mouse has no effect. Microsoft (wired) and mouse optical Logitech (wireless) tested.

    However:

    on a system that is completely up-to-date (Windows 10 Pro N, 1511 version, build 10586,63 x 64 / InDesign CC 2015.2, to build a 11.2.0.100 x 64) it works - there is no mouse pointer disappears.

    Have not the opportunity to test on any other configuration now.

    Could someone confirm this mouse related volatility on Win7/CS6, or is it quite unique in my system?

    And another question:

    Is it possible to activate here cycling through radio buttons to arrow keys, as he works in the script of this Marc Autret?

    http://www.Indiscripts.com/post/2009/09/clean-up-your-pasteboard

    He would let me live with the 1st problem unsolved... Anyway, the keyboard-based workflow is preferable.

    Behold, this is my version changed so far. However, it comes in the same way as described above.

    w=new Window("dialog", "Code");
    radio=w.add("panel", undefined, "Choose Action");
    w.alignChildren="fill";
    radio.optionbtns=radio.add("group");
    radio.optionbtns.orientation="column";
    option1=w.add("radiobutton", undefined, "Action One");
    option2=w.add("radiobutton", undefined, "Action Two");
    option3=w.add("radiobutton", undefined, "Action Three");
    option4=w.add("radiobutton", undefined, "Action Four");
    option1.value = true;
    w.add ("button", undefined, "OK");
                if (w.show() == 1){  
         if (option1.value == true)  
         {alert("Action One!"); exit();};
         if (option2.value == true)  
         {alert("Action Two!"); exit();};
         if (option3.value == true)  
         {alert("Action Three!"); exit();};
          if (option4.value == true)  
         {alert("Action Four!"); exit();};  
        }
    {  
        exit();  
        };
    

    Your comments are greatly appreciated.

    Except the upgrade - this isn't an option so far, sorry, Adobe...

    Hello

    small changes, try this:

    var
      w=new Window("dialog", "Code"),
      radio=w.add("panel", undefined, "Choose Action"),
      option1=radio.add("radiobutton", undefined, "Action One"),
      option2=radio.add("radiobutton", undefined, "Action Two"),
      option3=radio.add("radiobutton", undefined, "Action Three"),
      option4=radio.add("radiobutton", undefined, "Action Four");  
    
    w.add ("button", undefined, "OK"); 
    
    option1.value = true;
    radio.alignChildren="left";
    radio.margins = [10,20,10,10];
    
    function handle_key (key)
    {
      var
      scope = radio.children.length,
      p, newPos, step;
      switch (key.keyName)
      {
      case "Up": step = -1; break;
      case "Down": step = 1; break;
      default : return;
      }
      for (p = 0; p < scope; p++)
      if (radio.children[p].value) {
      newPos = p + step;
      switch (newPos) {
      case scope: newPos = 0; break; // go to first
      case -1: newPos = scope - 1; // go to last
      }
      radio.children[newPos].value = true;
      break;
      }
      } // handle_key
    
    w.addEventListener ("keydown", function (k) {handle_key (k)});
    
    if (w.show() == 1){
         if (option1.value) alert("Action One!");
         if (option2.value) alert("Action Two!");
      if (option3.value) alert("Action Three!");
      if (option4.value) alert("Action Four!");
        }
    else {
        exit();
        };
    

    Can't help you with strange behavior mouse (no idea)

    Jarek

  • Using switch and case with Radio buttons

    Can I use the case switch with radio buttons?

    What will be the parameter to determine the choice like xfa.event.newText is used for the drop-down list.

    Aditya

    Hi Aditya,

    Select the exclusion group in the hierarchy (you have no script each option button) and select the click event. The switch statement would use the this.rawValue.

    Hope that helps,

    Niall

  • How to use a radio button state to calculate a value in another field

    I produce a registration form that uses radio buttons to specify an accommodation meals and requirements for individual registrants - separate option buttons select the meal (YES or NO) plan and the type of accommodation (NO THANKS, A, B or D).

    I want to ask the State of these boxes to option and, if selected (set), calculate the amount to pay for registration in the related areas of subtotal ( Plan -meals and accommodation).  In other words, based on the costs of $ for YES, A, B and D on a per Member basis, I want to enter an amount of $ in the subtotal fields 'meal Plan' and 'accommodation'.  In the ABSENCE or NO THANKS is selected, no calculation is necessary.

    The form attached, if a given registrant (for example Reg01) chooses to include a meal plan (selected option button M01-Y ), then in the numMEAL subtotal field must increment of $80.  Similarly, if Reg01 wants to book a double room (R01-D) I want to add $268 for the subtotal numROOM field.  It goes without saying that the numMEAL and numROOM fields must reflect the cumulative amount based on the requirements of all listed registered (Reg01 via Reg05)

    Example:  I want to use a FormCalc calculation something like... (If M01 - Y is set then $80) + (if M01 - Y is set then $80) + etc ... to calculate the value of the field numMEAL and any other equivalent expression for the numROOM field.

    Also (but don't feel you have to answer), in the design-time view how to configure to display radio button selections No. or NO THANKS as the default selection (set) such as the other buttons in the PLAN of FOOD groups and the TYPE of ROOM are not selected (not set) - (I think that would correct indications of error that I see).  I managed to configure this radio button state initial for groups TYPE CITIZENSHIP and PAYMENT of the form but can't seem to do for groups of PLAN of MEALS and the TYPE of ROOM .

    Thanks in advance for your help.

    I think this is what you wanted... .view attachment. The problem with multiple selections in Design view is cause-in the name. I changed it to the rooms because it is to be interpreted as a subtraction. You must change them in meal option buttons as well and that will clear up the design problem you mentioned.

    To get the room to add correctly, I changed the value for the room price. Then on the event rentals field calculate I simply add all room radioButtonList. The calculate event fires whenever a room is changed. For meals, I put the code on the RadioButtonList to every meal (just to show you a different technique). You could od it exactly the same way as the rooms but it is up to you.

    Paul

  • Stop the loops with a button

    I have an infinite loop is and display of data. How can I end the loop with a button or a keypress?

    Periodically perform a ProcessSystemEvents() call inside the loop. In a reminder of the STOP button, set a flag to indicate your loop to stop.

    stop unsigned int = 0;

    While (! stop) {}

    data getmeasured

    display the data

    ProcessSytemEvents()

    Sleep (250);   to be polite: it is impolite to spinlock, since you will monopolize the CPU and other threads can get hungry

    }

    then, in the reminder for a STOP button

    STOP the button callback routine

    stop = 1;

  • Small problem with radio buttons

    The form I designed is all complete, but the only question that I have is there is a list of radio button that gives me bad.  The list of radio button controls the presence of a section based on Yes or no.  After the selection is made, it works very well, but when the document is saved and reopened again as well the button Yes and radio are selected.  How can I fix?  Please help, thanks.

    Sorry, I don't understand - Group exclusion "drop-down.

    When you click on the exclusion of radio button group, is that the object > liaison palette should look like:

    Niall

  • What is the problem with this WHERE statement?

    What is the problem with this WHERE statement?

    < cfquery datasource = "manna_premier" name = "kit_report" >
    SELECT SaleDate,
    TerritoryManager,
    Distributor,
    DealerID,
    Variable,
    US_Dealers.ID,
    DealerName,
    DealerAddress,
    DealerCity,
    DealerState,
    DealerZIPCode
    Orders, US_Dealers
    WHERE US_Dealers.ID EQ DealerID AND SaleDate BETWEEN #CreateODBCDate (FORM. Implementation) # AND #CreateODBCDate (FORM. End) #.
    ORDER BY SaleDate
    < / cfquery >

    It's driving me crazy!

    Syntax error (missing operator) in query expression ' US_Dealers.ID EQ DealerID

    You accidentally use the CF equals operator: "EQ".

    Instead of MS Access: «=»

    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver]...

    in a query expression. AND SaleDate BETWEEN #10/1/2009 #-October 18, 2009 #'.

    I don't see how CreateODBCDate() would produce these values.  But maybe it's just a quirk of the error message?

  • The use of JavaScript with radio buttons selected to assign a variable a value

    Hey everyone, a little new in Java and try to create a form for my work to request leave.  My problem is that I'm trying to assign a variable a value if the user clicks on a radio button or another.  Currently, they are incompatible with the following information:

    Name: Radio

    ToolTip: choice

    Button Style: check

    Radio button choice: Yes (this is the value of exports, that I think that I'm not sure how to use it correctly)

    nor is checked by default, but if a box is checked, I would have a variable defined on the "Approved" text, and if the other radio button is checked I would define the variable contains "disapprove".

    Here is my code now and thanks in advance for all the help:

    var S_auth;

    function auth() {}

    If (Radio.value == 'Yes') {}

    var S_auth = "approved";

    }

    else {}

    var S_auth = 'denied ';

    }

    }

    var employees = this.getField("Emp_Name").value;

    Supervisor of var = this.getField("Supervisor").value;

    var Leave_Type = this.getField("Dropdown2").value;

    var cToAddr = [email protected];

    var cCCADDr = this.getField("Email").value;

    var cBenAddr = this.getField("Sup_Email").value; If (cBenAddr! = "") cCCADDr += ';' + cBenAddr;

    var cSubline = "Re: leave request form for" + "" + employee + ', ' + Leave_Type + ', Status: "+ S_auth;"

    cbody var is 'your request for leave was' + S_auth + 'by' + supervisor. \n' + 'save the attachment of e-mail for your records. \n » ;

    this.mailDoc({)

    bUI: true,

    cTo: cToAddr,.

    cCc: cCCAddr,.

    bassujetti: cSubLine,

    CMSG: cbody

    });

    I honestly just want to have the subject line and the body to be able to show approved or disapproved according to which radio button, the project manager chooses.

    Yes, your script is now correct and should work.

  • How to manage the current line with radio button selection?

    Hello world

    I have an ADF page with a table and a search"" button.
    I created a new attribute with VARCHAR2 (1) in the VO and dragged this attribute as the first column of the table. And changed this first column of the option button to select only a single line at a time.
    By clicking on the "Search" button, I need to get the current selected row values.

    How can I get the values of selected line?
    What code should I write to get the values of the selected line in the method of binding the button 'search '?

    All suggestions will be really useful.

    Thank you.

    Hello Kumar,
    I have a few comments on your case.
    >
    I created a new attribute with VARCHAR2 (1) in the t
    >
    1. you should create this attribute in the object of the entity, and then add it to the view object.
    2-do you need this radio that a button is defined for all lines? If yes then you need handle the case where the user set several lines and clear the value of the attribute for all other lines.

    >
    How can I get all the values of the current row in backing bean, binding of the Find method (method)?
    can u please give me the code for this?
    >
    If you mean by the current row is the row for which the value of the selected attribute is defined (the radio button is set to the rank), then you can write a method in the viewObjectImpl class and expose it to the customer interface and call it from your bean.
    Here is a sample Department table in the HR schema.

    //This method is written in DepartmentsViewImpl
    public Row getSelectedRadioRow(){
                //create a second row set to not impact the row set used in ADF
                RowSet duplicateRowSet = this.createRowSet("duplicateRowSet");
                //get the current row of the table to set it back after re-executing the VO
                DepartmentsViewRowImpl currentRow = (DepartmentsViewRowImpl)this.getCurrentRow();
                Row[] filteredRows = duplicateRowSet.getFilteredRows("IsSelected", "1");
                DepartmentsViewRowImpl row=null;
                if(filteredRows.length>0){
                    row = (DepartmentsViewRowImpl)filteredRows[0];
                    System.out.println("Department Name " + row.getDepartmentName());
                     }
                this.setCurrentRow(currentRow);
                duplicateRowSet.closeRowSet();
                return row;
            }
    
  • How can we have a column with the text and radio button in the same row?

    Hello

    I have a column that need to have data with a radio button. Has been able to achieve this by using < trh:tableLayout >. But when I select the option button it moves to the next line. You want to stop this behavior of option button to move to the next line. This column also includes a hyperlink. If the text and the hyperlink are made invisible visible based on the action of the radio button.
    Adding one more doubt. A horizontalgrid of specific columns can make invisible?
    Any help would be appreciated.

    example code:
    < trh:cellFormat id = "cf8" halign = 'Start' >
    < af:activeOutputText value = "#{rank." Actions}"id ="aot2"/ >
    < af:goLink text = ' #{rank. " Actions}"id ="gl1 ".
    clientComponent = "true" visible = "false".
    targetFrame = "_blank" destination = "http:// + #{rank." BUTTON_URL} ">"
    < / af:goLink >
    < af:selectBooleanRadio text = "" id = "sbr1" > "
    < af:clientListener method = "selectCheckBox" type = "click on" / >
    < / af:selectBooleanRadio >
    < / trh:cellFormat >

    Thank you
    Nita

    Remove the components from . Put the other components like the direct children of the PanelGroupLayout:

    
      
        
        
        
        
          
        
      
    
    

    If you need to add some space between the components horizontan, you can put (s) between components.

    Dimitar

  • Preloads the Radio button States

    I have a multiple choice quiz that uses radio buttons for users to choose a response from A to D. It tells you if you are correct or not, and allows you to progress when you give the right answer. The answers are stored in an external database. I remember the latter on the loading module in variables, but I need to know how to use the variable automatically check the correct in each question when a user returns in the quiz. So, they can see their previous answers because these boxes are automatically checked.

    Can someone help me to do this? I can't make it work.

    "Mark Tomlinson" wrote in message
    News:epcupt$9rd$1@forums. Macromedia.com...
    > I think you need this line instead of Amy:
    >
    > Checked@ChildNumToID (IconID,
    (> Code (MultipleAnswer [CurrentPageNum])-(Code ("A") - 1)): = TRUE - that is to say you
    > need a true assignment

    You are right. I tend to forget this part when the quick entry.

    > You must also make sure that the file is set up as she says to
    > a framework and your answers must be in a list called MultipleAnswer
    > which will look something like ['A', 'C', 'B', "D"].
    >
    > You can set as you spend your response in the interactions of the question
    > with something like [CurrentPageNum] MultipleAnswer: = 'A' (assuming they had
    > selected A and we are in the path of the answer: a.
    >
    > You can store the list in your database to the exit and re initialize it
    > the database when you then run the piece.
    >
    > You should be able to get it going now, I think?
    >
    > Mark
    >
    >
    > 83Dons wrote:
    > I can't seem to get your code works amy, any chance you could send me it
    > complete a question so I can try to get this working?
    >>
    > Much obliged
    >
    > --
    > ------------------------------------------------------
    > Authorware media synchronization command:
    >
    > www.authorwarextras.co.uk--> orders
    >
    > Synchronization of media with ease!
    >
    > EuroTAAC eLearning 2007
    > www.eurotaac.com
    >
    > www.AuthorwareXtras.co.uk
    > www.freelists.org/list/flashelearning

  • With the help of the checkbox or radio button

    Dear,
    How to use the checkbox for option button? I would like to have 4 checkbox option buttons, for cases 'everything' and 3 other cases.
    And by clicking on a link, I'll build a statement according to the selected linh slect and the selected area.

    Could someone help me?

    Thank you.
    Celio

    Hello

    As long as the tables/columns can be the same, a report should be ok.

    On my page, option buttons are defined as a LOV using:

    STATIC2:All;ALL,Department 10;D,Names beginning with A;A,Salary > 2000;S
    

    So 'All' return 'ALL', ' Department 10 "returns"D", 'Names...' returns 'A' and"Salary..." ' returns "S".

    My report SQL statement is:

    SELECT EMPNO, ENAME, DEPTNO, NVL(SAL,0) SAL, NVL(COMM,0) COMM
    FROM EMP
    WHERE
    (:P176_REPORT = 'ALL')
    OR
    (:P176_REPORT = 'D' AND DEPTNO = 10)
    OR
    (:P176_REPORT = 'A' AND UPPER(ENAME) LIKE 'A%')
    OR
    (:P176_REPORT = 'S' AND NVL(SAL,0) > 2000)
    

    So if the user selects "ALL", the report would return all records that the first condition would be true, if they chose "D", the second condition would become true, so only records where the DEPTNO = 10 would be returned, as so on.

    Andy

  • jdev11 - how the code filter additional liaison with radio buttons?

    Using JDev 11.1.1.0.2, ADF BC for model, ADF Faces JSF to view, deploy to WebLogic 10.3 appserver, database Oracle 11

    I asked for help (a do my work ask), that I'm the only developer JDev in our shop, and I looked at this problem too long and now have obscured the problem. I don't really want the answer (rather the skills needed to solve this problem), but it will ;-)

    Installation program:
    ExecwithParam base where the logic is stored in the AppModule. At this point, there is only a single binding TechID variable, which is passed to four of your different and updates the where clause and calls on each VO of the AppModule executeQuery. Works great so far!

    Need:
    Add additional time based filter: Group of buttons on the Radio for the last 30 days, 60 days, 90 days, choose a date. If choosing a date is sΘlectionnΘe, then the user selects a date with a date picker, and all records by this date are used.

    Support:
    There is a date variable in each query, and a common type of DATE filterDate may be added to each to filter with somedatefield > =: filterDate in each VO

    Thoughts:
    I like to break things in simple parts, so how about starting just the radio button.
    My thinking goes like this:
    Add another variable of filterDate liaison to each of your. Add this to the App Module.

    So, how can I set up a radio button so that I can get the value of the selected and then button that convert a SYSDATE - value and which use th e App Module logic? I continue to think of the big picture end of case and forget everthing. I know that's not difficult, but just ask me for some advice.

    At one point, I was thinking to add a clove of support to the option button, then wasn't sure if it was the best way and don't know how I would get the value in the AppModule. Part of the problem is that I came across a mental block. If I add the components that aren't linked data, as a selector of dates, or checkboxes, radio buttons, etc.. How can I get the values in the AppModule? I've seen many examples of data to related components, but do not know how to mix and match the binding with just a rich component controls base such as an input control. (This may better ask in a different thread).

    Finally, what of the big picture, the part about the addition of the datePicker - of ideas?

    Like cable TV, characters hosted - the kind that are related in my case the code! (Reference of American humor, must be familiar with USA cable TV channel (I'm addicted to the show House))

    Thank you, Ken

    Ken,

    A small correction to your last sentence - you don't want to refer to the support of the AM bean - you want to refer to the AM of the bean to support.

    If you want a very simple way: find the service for your AM method in the data control palette, drag-and - drop it on your page as a button JSPX. JDeveloper will automatically add a binding for the action in the pagedef. Then, double-click the button that results and create a new method of bean of support for her (in front of JDev, don't remember what we call the dialog box) - given the option, say JDev to put the code to link to you - then the resulting method should have the code that calls the method via the definition of the page. Simply add a bit of extra code to determine and set the date.

    John

  • Calculation of the numeric fields radio button and checkbox-based response

    I am to change a form that was created by someone else.  I added checkboxes and radio buttons based on the need to form. I would like for the amount of check calculate automatically based on the selection of a radio button.  I've implemented some numeric fields to play with adding the amounts and placed them in the field 'Amount to check', but I can't seem to calculate.  Once I have to calculate correctly, I need to know how to automatically enter a number in the appropriate digital field based on the option button or check box selected.  Here is a picture of what I've put up.  Help, please!  I read all the forums, watched the videos and tried everything.  I'm so frustrated.

    MemberStatusHelp.jpg

    Don't know if I have the layout if correct me if Im wrong. I assume you have a radio button group on the top line for the first 3 check boxes and boxes (when the user selects one) for the following 2 lines (where the user can select independently of the other 3 above) with a final calculation at the end to check the amount field.

    You can either place the code on each change of each checkbox/radio button event to recalculate or just do it on the final checksum field. I tried putting a calculate on the last field to check the quantity, and it seems to do what it takes.

    Try this in the case of calculating the amount of check field

    var membershipAmount = 0;
    if ( (RadioButtonList.rawValue == "2") || (RadioButtonList.rawValue == "3") )
    {
        membershipAmount = 35;
    }
    
    if (CheckBox1.rawValue == "1" )
    {
        membershipAmount += 15;
    }
    
    if (CheckBox2.rawValue == "1" )
    {
        var txtAmount = TextField3.rawValue;
        var amt = 0;
        if ( (txtAmount != null ) && (! isNaN(txtAmount) ) )
        {
            amt = parseFloat(txtAmount);
        }
    
        membershipAmount += amt;
    }
    
    this.rawValue = membershipAmount;
    

Maybe you are looking for