Calculate the value based on the selection of the checkbox
People from g ' Day,.
I have myself a little stuck on a job that I have here, this javascript Gets the better of me.
The idea is that this script takes the total sub and adds a surcharge for credit card (in percentage) based on a selection of the checkbox, then spit out the value to be entered in another field.
If someone could have a quick look over what follows and let me know where I went wrong, it would be appreciated.
---
Subtotal var = this.getField("SubTotal").value;
var mastercardTick = this.getField ("MasterCard");
var visaTick = this.getField ("Visa");
var amexTick = this.getField ("Amex");
Var extra = this.getField("CreditSurcharge").value;
card credit var = this.getField("PayCredit").value;
If (creditcard.value = 'Off') {}
Event.Value = 0;
} else {}
If (mastercardTick.value = 'Yes') {}
overload. Value = (1,2 / 100) * subtotal.value;
} ElseIf (visaTick.value = 'Yes') {}
overload. Value = (1,2 / 100) * subtotal.value;
} ElseIf (amexTick.value = 'Yes') {}
overload. Value = (3.75 / 100) * subtotal.value;
} else {}
Event.Value = 0;
}
}
---
For lines like these:
overload. Value = (1,2 / 100) * subtotal.value;
If it should not be as:
Event.Value = (1,2 / 100) * subtotal.value;
The variable supplement is defined at the beginning of the script to the value of the field, so the surcharge.value parameter is not any sense.
Tags: Acrobat
Similar Questions
-
Calculate values based on the boxes are checked - for Dummies...
Hello and thank you all in advance for your help. I'm trying to calculate a value based on the boxes checked. Specifically, I would like to add a particular value $$ each CheckBox and if this box is checked, I want to add to the total rental value (see screenshot below):
As you can see in the screenshot that I have different areas that can be selected (first floor, court before, etc.), I want to assign a value to the checkbox of each region (and added value for others) and calculate a total in the "Balance of rental fees" less the deposit. I'm new with java and scripts but not know how to do it in an excel formula. I guess it's very different from what little I know of Java. Any help you can give me would be greatly appreciated.
Calculation options are in the text field. In this screen, you only need to set the value of exports to the amount this box represents.
-
How to calculate the sum of two digital form fields based on the selection of the checkbox.
I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B
_ Field - 2
_ Field - A 4
[check] _ _ field - 6 C
[disabled] _ _ field - 2 C
Thank you
The custom field C calculation script could be:
(function () { // Get the values of the text fields, as numbers var v1 = +getField("A").value; var v2 = +getField("B").value; // Set this field's value based on the state of the check box named "CB" if (getField("CB").value !== "Off") { event.value = v1 + v2; } else { event.value = v1; } })();
Replace 'A', 'B', and 'CB' with the real names of the fields.
-
Calculate the attribute (entity) Total value based on a specific entity
I'm writing a calc that will calculate a total based on an attribute (entity) and based on a specific entity. I am currently able to calculate the total value of the attribute by using @SUM (@ATTRIBUTE (attrmembername)). I tried specifying the entity specifi in DIFFICULTY, but it is still calculating the total of the entire dimension, rather based on a specific entity. I would greatly appreciate any suggestions. Thank you!Use the @REMOVE function to exclude members that you do not want. The FIX is not your problem. Within the function, when you call @ATTRIBUTE, you get all basic members associated with this attribute.
So in your @SUM function that you must exclude members you won't be part of the sum.Suppose you had a structure where you had a '1' attribute that has been associated with several children of 'A' and 'B', but in your sum function, you want only to the sum of the members who have the '1' attribute, AND are children of "A". If you want to exclude with the attribute members that are under the 'B '.
@SUM (@REMOVE (@ATTRIBUTE("1"), @CHILDREN ('B'));
-
How to calculate the limits of dynamic range based on a value
Hi all, I need to create a function that accepts as parameters:
Ticket_id NUMBER
NUMBER fluctuation
Resolution_time NUMBER
For each Ticket_id, the function should calculate the Resolution_time who "go time" according to the Fluctuation_ratio.
For example:
Ticket_id = 12
Fluctuation_ratio = 0.5
Resolution_time = 1.6 (hours)
The fluctuation_ratio said that the range increased by 0.5 hours each time. So in this example, it must consider lines like these:
"0-0, 5 h'"
"0,5- 1 h"
1 to 1.5 h'
'1.5 to 2 h'
..........
So the function must return the string: * "1.5 to 2 h."
If the fluctuation_ratio was 3, the lines had to be:
"' 0 - 3 hours"
3 6 h"
6 9 h'
9 12 h'
..........
and the function should return the string: *'0 - 3: "*"
Anyone know how I can achieve this? Is there an analytic function which calculate each time the lower and the upper limit of the range 'hour '?
Thanks in advance, any help will be appreciated
AlexHello
Here's a function that does what you requested:
CREATE OR REPLACE FUNCTION resolution_range ( in_fluctuation IN NUMBER , in_resolution IN NUMBER ) RETURN VARCHAR2 DETERMINISTIC IS low_val NUMBER := in_fluctuation * FLOOR ( in_resolution / NULLIF (in_fluctuation, 0) ); return_txt VARCHAR2 (4000) := TO_CHAR (low_val) || '-' || TO_CHAR (low_val + in_fluctuation) || 'h'; BEGIN RETURN return_txt; END resolution_range ;
I tested it using this query:
WITH test_data AS ( SELECT 12 AS ticket_id, .5 AS fluctuation_ratio, 1.6 AS resolution_time FROM dual UNION ALL SELECT 13, 3, 1.6 FROM dual ) SELECT test_data.* , resolution_range (fluctuation_ratio, resolution_time) AS range FROM test_data ;
and got this output:
TICKET_ID FLUCTUATION_RATIO RESOLUTION_TIME RANGE --------- ----------------- --------------- -------------------- 12 .5 1.6 1.5-2h 13 3 1.6 0-3h
-
Hi all
I need the values according to below 2logics in a single select query using instring and substring
1 values based on the following logic 'values after the first values of two '_' and before last '_' values '.
2 values based on the following logic 'values after the first values of two '_' and before last'-'values '.
EXM:
Entry: ABCD_EFGH_IJKLM - NOPQ_XYZ output: IJKLM - NOPQ
Entry:. ABCD_EFGH_IJKLM - NOPQ output:IJKLM
Thank you.
Check the following
WITH DATA1 AS
(SELECT "ABCD_EFGH_IJKLM - NOPQ_XYZ" double val)
UNION ALL
SELECT 'ABCD_EFGH_IJKLM - NOPQ' double val
)
SELECT SUBSTR (VAL, INSTR(VAL,'_',1,2) + 1, DECODE (BIGGER (INSTR (VAL, '_',-1, 1), INSTR(VAL,'-',-1,1)), INSTR (VAL,'-', - 1, 1), LENGTH (VAL) + 1, INSTR (VAL, '_',-1, 1))-(INSTR (VAL, '_', 1, 2) + 1))
OF DATA1;
Concerning
Salim
-
monetary value for the selection of the checkbox?
I have a price list page 5 which has checkboxes for items people want to buy. I want to add a dollar value on the box so that if the item is selected, I can get a box of total at the end of the form that calculates all checked/ordered. I looked at the forums and I see Javascript, but impossible to find the right solution - I'm a novice at JavaScript. Any help would be much appreciated.
I have a text box invisible with the prices "1100XL PRO" and a check box beside it called CheckBox1.
Is this correct and how to link the two?
Thank you in advance.
You can set the price as the value of the field to export, in fact, and then you would only need to use a single field.
You will find this setting under properties of the checkbox, Options tab.
-
Textarea conditional display based on the value of the checkbox.
Hi all
I have a question regarding the conditional display of an article based on the value of the checkbox.
I have a checkbox in a region, which is a STATIC LOV:; Y and the text box in the same region. Now I want to show this textarea only if the check box is selected. ??
Please suggest how to achieve this.
Thank you
DC
Hello
I guess that you are 4.2 Apex as you haven't shared the same.
- Create a dynamic Action on change of box which should present the value of the checkbox and update the TextArea element.
- Then continue as conditional Textarea with checkbox value.
BR,
Patrick
-
Hi, I have a form that contains a single reference, name of the partner and three values. I am trying to add a new element that adds the three values based on the ID and displays the result.
It's the sql which I use and it works if I type in a value for the ID fix, but when I replace it with 'P5_ID' I get the error below when the form is used. I can save the changes to the page OK.
I would appreciate help with this.
Thank you
Steve
Select
("Data_PSDM_Fcst". "' Month1_Act ' + 'Data_PSDM_Fcst '. "' Month2_Act ' + 'Data_PSDM_Fcst '. (' "Month3_Act") as "QT4.
of 'Data_PSDM_Fcst' 'Data_PSDM_Fcst '.
WHERE ID = P5_ID
ORA-00904: "P5_ID": invalid identifier
SteveKerry-Oracle wrote:
Hi, I have a form that contains a single reference, name of the partner and three values. I am trying to add a new element that adds the three values based on the ID and displays the result.
It's the sql which I use and it works if I type in a value for the ID fix, but when I replace it with 'P5_ID' I get the error below when the form is used. I can save the changes to the page OK.
I would appreciate help with this.
Thank you
Steve
Select
("Data_PSDM_Fcst". "' Month1_Act ' + 'Data_PSDM_Fcst '. "' Month2_Act ' + 'Data_PSDM_Fcst '. (' "Month3_Act") as "QT4.
of 'Data_PSDM_Fcst' 'Data_PSDM_Fcst '.
WHERE ID = P5_ID
ORA-00904: "P5_ID": invalid identifier
To use a value of element in SQL or PL/SQL of APEX block, use a reference variable to bind that precede the name of the element of the colon ("": "):
select ("Data_PSDM_Fcst"."Month1_Act" + "Data_PSDM_Fcst"."Month2_Act" +"Data_PSDM_Fcst"."Month3_Act") as "QT4" from "Data_PSDM_Fcst" "Data_PSDM_Fcst" Where ID = :P5_ID
I also highly recommend that you stop what you are doing now, remove all database objects that were created with identifiers respecting case-sensitive and re-create them according to standard practical Oracle so that they are case-sensitive. By the database SQL language reference:
Note:
Oracle does not recommend the use of identifiers in quotes for the names of database objects. These city identifiers are accepted by SQL * Plus, but they may not be valid when using other tools that manage database objects.
Names of objects sensitive to case and between quotes identifiers will only cause confusion and error.
-
Adobe Acrobat Standard DC - calculate, the value is the "sum" of
The "text field properties / calculate / value is the 'sum' of the following fields / pinch / field selection"window does not provide any options to select. " I formatted all the fields in the source & field sum as 'number' and out spaces in domain names. My version of Acrobat Standard DC excludes a Sum function? Thank you, all!
It displayed fine. It looks good, so I don't know why there is no fields displayed when you click the button to 'Pick '. I always use the JavaScript option, but you can try the option of simplified field notation to work around the problem. You need to enter something like:
Field1, Field2, field3 and field4
Where are the names of the fields that you want to calculate the total, so change to match your domain names.
-
Calculate a value for the years annually or monthly or quarterly
Hi gurus -.
I have a requirement to divide a given sum monthly/quarterly/annually in recent years, based on the date of departure. So I need the logic of pl/sql to achieve it. Please help me and let me know if the questions.
Here is my example:
Let's say amount = 240, date start = January 1, 2013, term = quarterly or annually / monthly, years = 5 years (so now I need to calculate the amount for five years from January 1, 2013 to 31 December 2017 and the output should like below)
Month Monthly amount Amount quarterly Annually the amount January 1, 13 20 60 240 February 1, 13 20 March 1st, 13 20 April 1, 13 20 60 May 1, 13 20 1 June 13 20 July 1, 13 20 60 1 Aug 13 20 1-13-seven 20 October 1, 13 20 60 November 1, 13 20 1st December 13 20 1 January 14 20 60 240 February 1, 14 20 March 1, 14 20 1 April 14 20 60 May 1, 14 20 June 1, 14 20 July 1, 14 20 60 August 1, 14 20 1 sep-14 20 1st October 14 20 60 November 1, 14 20 1 December 14 20 Thank you very much!!!
Hello
Maybe something like this:
WITH bs AS
(
SELECT 240 * 5 AS amt
, TO_DATE (JANUARY 1, 2013"
"LUN-DD-YYYY".
) AS special and differential treatment
12 * 5 AS total_payments
9 AS first_group
12 AS cycle_length
OF the double
)
SELECT TO_CHAR (ADD_MONTHS (special and differential treatment, level - 1)
"LUN-DD-YYYY".
) AS mnth
CASE
WHEN MOD (FLOOR - 1, cycle_length) = 0
THEN the LEAST (first_group
total_payments + 1 - LEVEL
) * amt / total_payments
WHEN MOD (FLOOR - 1, cycle_length) > = first_group
CAN amt / total_payments
Payment END AS
BS
CONNECT BY LEVEL<=>=>
;
-
Process of calculation to calculate the value after submit after all validations
Hello
Please help with a possible approach or suggestions for the calculation process.
I have a calculation process after submit I want to calculate its value after that all validations are handled. Because this process of calculating trim is off of the first part of the input string of the user for the P3_USES element. Thus, for example consider; the user selects a value for P3_USES (point list manager) to be "TAC"... BCA... BCA... BCA... 0.CA BC... "CA IT BC. So my calculation process just stripes off the coast of the first portion of the string and computes the value will be "BCA"... BCA... BCA... 0.CA BC... "CA IT BC. It works fine when all postings on the page are placed without cooking.
The problem occurs, then the validation fails on the form. Once the validation fails, the calculation process; already calculates the value and the P3_USES value form element is set to "BCA"... BCA... BCA... 0.CA BC... "CA IT BC. So, here the user solves the problem of validation and sends it again the form, but at this point the value is calculated again but this time that my string is "BCA"... BCA... BCA... 0.CA BC... CA IT BC"which is not correct, because my initial user string entry was"TAC"... BCA... BCA... BCA... 0.CA BC... "CA IT BC.
So my question is how they treat the value of my calculation after all validations. While I can keep the original value of the P3_USES element. I'm using the version of Oracle APEX 4.0 and Oracle 10 g R2 database.
Thank you
Rambeau
Hello
Combine code of calculation and validation?
Perform the calculations in the process?
Use another element to contain the value 'real '?
Kind regards
Jari
-
How to make the selection of the field to calculate the properties of the tab active
I try to make a purchase order that will calculate the values of fields, but I can only select all form fields or not. I got the trial AcrobatPro and it worked fine, but now I bought it, it does not work for me.
Can someone please.
Some people feel that for some reason any. You can try to use the SPACEBAR to toggle the checkbox and the tab key to move. You can apparently also use the mouse, but you will need to click anywhere near the border in checkboxes, so try to experiment a bit.
-
How to calculate the Total price based on a rate of m² with different prices?
Hello
I'm guessing that it is a script, but I've never done any script so I would like to ask you guys...
I have a form where I would calculate the total price for some carpet based on the price per sqm.
-L the user enters the number of carpet needed.
-There are different price points for 1-20, 21-60, 61 + m² (each with their own hidden field that contains the value of awards).
-The Total Price field evaluates the relevant quantity and multiply by the square metre rate.
Is it achievable?
I guess that all solutions are placed in the "Custom calculation Script" field too?
Thanks in advance!
Yes. You can use something like this, as the custom of the price field calculation total (you may need to adjust the domain names):
var sqm = Number (this.getField("SQM").value);
rate of var = 0;
If (sqm > 0 & m²)<=20) rate="">=20)>
ElseIf (> 20 sqm & m²)<=60) rate="">=60)>
ElseIf (> 60 sqm) rate = Number (this.getField("Rate3").value);
M² = Event.Value * side;
-
calculate the value of the query help
Hi all
Following the script nicely:CREATE TABLE ACCOUNT_LOOCKUP ( SERIAL_ID NUMBER, ACCOUNT_ID NUMBER, ACCOUNT_RATE NUMBER, ACCOUNT_MAX NUMBER ) ALTER TABLE ACCOUNT_LOOCKUP ADD ( CONSTRAINT PK_ACCOUNT_LOOCKUP PRIMARY KEY (SERIAL_ID, ACCOUNT_ID)); Insert into ACCOUNT_LOOCKUP (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX) Values (1, 1, 10, 200); Insert into ACCOUNT_LOOCKUP (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX) Values (2, 1, 12, 150); Insert into ACCOUNT_LOOCKUP (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX) Values (3, 1, 8, 400); Insert into ACCOUNT_LOOCKUP (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX) Values (1, 2, 7, 100); Insert into ACCOUNT_LOOCKUP (SERIAL_ID, ACCOUNT_ID, ACCOUNT_RATE, ACCOUNT_MAX) Values (2, 2, 5, 200); COMMIT; SELECT * FROM ACCOUNT_LOOCKUP SERIAL_ID ACCOUNT_ID ACCOUNT_RATE ACCOUNT_MAX ---------- ---------- ------------ ----------- 1 1 10 200 2 1 12 150 3 1 8 400 1 2 7 100 2 2 5 200 CREATE TABLE ACCOUNT_AMOUNT( ACCOUNT_ID NUMBER(10), ACCOUNT_AMNT NUMBER(10)) Insert into ACCOUNT_AMOUNT (ACCOUNT_ID, ACCOUNT_AMNT) Values (1, 9); Insert into ACCOUNT_AMOUNT (ACCOUNT_ID, ACCOUNT_AMNT) Values (1, 35); COMMIT; SELECT * FROM ACCOUNT_AMOUNT ACCOUNT_ID ACCOUNT_AMNT ---------- --------------- 1 9 1 35
I want by select query calculte ACCOUNT_TOTAL every ACCOUNT_ID exists in table ACCOUNT_AMOUNT as below , 1. every ACCOUNT_ID have SERIAL_ID and ACCOUNT_RATE and ACCOUNT_MAX in table ACCOUNT_LOOCKUP, 2. to calculte ACCOUNT_TOTAL every ACCOUNT_ID : - order ascending SERIAL_ID exists in table ACCOUNT_LOOCKUP to every ACCOUNT_ID exists in table ACCOUNT_AMOUNT , - make sum ACCOUNT_AMNT every ACCOUNT_ID in table ACCOUNT_AMOUNT, - then, copmare result (sum ACCOUNT_AMNT) with first record after ascending SERIAL_ID, - product (sum ACCOUNT_AMNT) * ACCOUNT_RATE result as ACCOUNT_TOTAL,(in ex: sum ACCOUNT_AMNT = 44 ) , - if ACCOUNT_TOTAL > ACCOUNT_MAX then * ACCOUNT_TOTAL = ACCOUNT_MAX for first record(in ex SERIAL_ID = 1 ) , * Goto the second record by ascending (in ex SERIAL_ID = 2 ) , make ( ACCOUNT_TOTAL / ACCOUNT_RATE ) for first record , ( 200 / 10 ) result 20 >> * calculate Remainder ACCOUNT_AMNT = the sum ACCOUNT_AMNT 44 - 20 = 24 *Goto the second record by ascending (in ex SERIAL_ID = 2 ) , Remainder ACCOUNT_AMNT 24 * (12) ACCOUNT_RATE for second record = 288 as ACCOUNT_TOTAL -if ACCOUNT_TOTAL > ACCOUNT_MAX then * ACCOUNT_TOTAL = ACCOUNT_MAX for second record(in ex SERIAL_ID = 2 ) , * Goto the third record by ascending (in ex SERIAL_ID = 3 ) , make ( ACCOUNT_TOTAL / ACCOUNT_RATE ) for second record , ( 150 / 12 ) result 12.5 * calculate Remainder ACCOUNT_AMNT = the sum ACCOUNT_AMNT 24 - 12.5 = 11.5 Remainder ACCOUNT_AMNT 9.5 * (12) ACCOUNT_RATE for third record = 92 result as ACCOUNT_TOTAL if result <= ACCOUNT_MAX then ACCOUNT_TOTAL = 92
except result ------------ SERIAL_ID ACCOUNT_ID ACCOUNT_RATE ACCOUNT_MAX ACCOUNT_TOTAL ** explain ** ---------- ---------- ------------ ----------- ------------- ***** sum ACCOUNT_AMNT = 44 for ACCOUNT_ID = 1from table ACCOUNT_AMOUNT ****** 1 1 10 200 200 >> (44 * 10 ) = 440 >> 200 /10 rate = 20 >> 44 - 20 = 24 Remainder ACCOUNT_AMNT 2 1 12 150 150 >> (22 * 12 ) = 288 >> 150 /12 rate = 12.5 >> 24 - 12.5 = 11.5 Remainder ACCOUNT_AMNT 3 1 8 400 92 >> (11.5 * 8) = 92 And so on ....
Help me pleaseanother insert Insert into ACCOUNT_AMOUNT (ACCOUNT_ID, ACCOUNT_AMNT) Values (2, 10); SELECT * FROM ACCOUNT_AMOUNT ACCOUNT_ID ACCOUNT_AMNT ---------- --------------- 1 9 1 35 2 10 except result ------------ SERIAL_ID ACCOUNT_ID ACCOUNT_RATE ACCOUNT_MAX ACCOUNT_TOTAL ** explain ** ---------- ---------- ------------ ----------- ------------- ***** sum ACCOUNT_AMNT = 10 for ACCOUNT_ID = 2 from table ACCOUNT_AMOUNT ****** 1 1 10 200 200 2 1 12 150 150 3 1 8 400 92 1 2 7 100 70 10 * 7 = 70
Thanks in advance
Published by: 900510 on December 5, 2011 08:05900510 wrote:
Hi allFirst I want to apologize for my English, this isn't flunet.
Following the script nicely:
CREATE OR REPLACE VIEW V_ACCOUNT (ACCOUNT_ID,ID,ACCOUNT_RATE,ACCOUNT_MAX,ACCOUNT_TOTAL) AS SELECT 1, 2, 10 ,200 , 0 FROM DUAL UNION SELECT 1, 5, 12 ,150 , 0 FROM DUAL UNION SELECT 1, 9, 8 ,400 , 0 FROM DUAL UNION SELECT 2 ,1, 7 ,100 , 0 FROM DUAL UNION SELECT 2 ,3 ,5 ,200 , 0 FROM DUAL ORDER BY 1,2 ACCOUNT_ID ID ACCOUNT_RATE ACCOUNT_MAX ACCOUNT_TOTAL ---------- ---------- ------------ ----------- ------------- 1 2 10 200 0 1 5 12 150 0 1 9 8 400 0 2 1 7 100 0 2 3 5 200 0
I must be missing something... in your opinion, by definition does only selected literals 5 double. How you expect what you do for any other table to change those returned by the view?
Published by: EdStevens on December 5, 2011 08:51
Maybe you are looking for
-
My Hotmail watcher has stopped working since last week. I uninstalled and reinstalled several times different, but it did not help
-
Horizontal lines at the top of the screen - Satellite A100
Horizontal lines appear at the top of my A100 after use of the preview of the slide show or any photoshop program. It can be removed when the image of the desktop is changed. The laptop was bought in April this year. Geoff
-
Why Assassin's Creed does not start full screen mode?
I have to type Alt + Enter whenever I want to play AC.
-
I have windows XP and a tomtom Go740 when I try to download the updates of card I have an accident and get Fastfat error - has anyone else had this problem [Moved from comments]
-
The 7520 print (no photos) without the photo black installed?