Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Calculation

Avatar

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct Reply

0 solutions
View profile
_Win_Lam_
Level 2

14-05-2008

Can any great genius pls help me out on this?<br /><br />I have a radio button with options of selecting a 5% or 10% discount and a Total Price numeric field.<br /><br />I need help in creating a script for:<br /><br />If Radio Button is selected then<br />Total Price = Sum(a,b,c) <already on FormCalc/Calculate Event> * Price Discount <radio Button in ExclGroup><br /><br />Please help... i've been working on it for days...

Replies

Avatar

Avatar
Validate 1
Level 3
Ruytero-HzmPcE
Level 3

Like

1 like

Total Posts

101 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 3
Ruytero-HzmPcE
Level 3

Like

1 like

Total Posts

101 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
Ruytero-HzmPcE
Level 3

15-05-2008

Hi Win,



Can't you make an if-statement to see wich rdo is selected and then calculate that discount?



Regards,

Avatar

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct Reply

0 solutions
View profile
_Win_Lam_
Level 2

15-05-2008

Hi Ronny,<br />I'm sorry i guess i'm too new to have understand your question to script on the above.<br /><br />Currently, i have a Total Price field at calculate event on <FormCalc>with the following:<br /><br />$.rawValue = Sum (a,b,c) * Prem: computation is accurate but Total Price is not reflected in the field when the Discount <Radio button> is not selected.<br /><br />So when i transform the script language to Javascript, it doesn't work at all.<br /><br />So i want the premium to be reflected even when radio button is not selected and then calculate the actual Total Price when form filler selects the type of discount.<br /><br />Can you help on this?

Avatar

Avatar
Validate 1
Level 3
Ruytero-HzmPcE
Level 3

Like

1 like

Total Posts

101 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 3
Ruytero-HzmPcE
Level 3

Like

1 like

Total Posts

101 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
Ruytero-HzmPcE
Level 3

15-05-2008

Hi Win,



I created a sample below is the formcalc script I have on the calculate-event of the Total-field.



if (rdoDiscount.rawValue eq "5") then

$ = (Sum(numVal[*]) * (5/100)) + Sum(numVal[*]);

elseif (rdoDiscount.rawValue eq "10") then

$ = (Sum(numVal[*]) * (10/100)) + Sum(numVal[*]);

elseif (rdoDiscount.rawValue eq "15") then

$ = (Sum(numVal[*]) * (15/100)) + Sum(numVal[*]);

else

$ Sum(numVal[*]);

endif



For the rest I have two value fields (both named numVal)

and three radiobuttons with the value specified in the Binding properties.



If you would like the sample I can mail it to you.



Regards,



RonnyR

Avatar

15-05-2008

Hi,

I think that a good solution could be use a drop-down-list (if you can)

In his Exit event you can call a function to whom pass the value selected.





obviously the function makes the calculations you want.



No "if" statement and better maintenance of the code 🙂



I hope this helps.



Roberto Bellarmino

Avatar

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Win_Lam_
Level 2

Likes

0 likes

Total Posts

33 posts

Correct Reply

0 solutions
View profile
_Win_Lam_
Level 2

15-05-2008

Dear Ronny,

Thanks so much.



Yes, maybe if you can mail me the sample for a better reference.

Sorry for the trouble.



Regards,

Win