Forum
Calc Builder Support
Calc Builder supportForums
Public write access is disabled. Please login
Re: Multiple option value 21.10.2011 14:23
Hello,
In multiple option variable you can get an array of values selected. We
attached a simple example, ready to import in Calc Builder, to help you to see better. Please check download section (examples) of Calc builder
Hope this helps.
Moonsoft Team
www.moonsoft.es
In multiple option variable you can get an array of values selected. We
attached a simple example, ready to import in Calc Builder, to help you to see better. Please check download section (examples) of Calc builder
Hope this helps.
Moonsoft Team
www.moonsoft.es
Re: Multiple option value 28.10.2013 19:54
Hello,
you can see how multiple option is recovered at the example
Recover selected values from all input types
Some quick tips:
For multiple option, what you get is an array of values, so
$multiple[0] would be the first value selected
$multiple[1] the second, etc.
if you need to know how many options are selected
count($multiple)
will give you the number.
And finally
$result=0;
for($i=0;count($multiple)>$i;$i++){
$result=$result+$multiple[$i];
}
Will add at the $result every value selected (if numeric).
Hope this helps
Edited by MSTeam - 28.10.2013 19:55
Moonsoft Team
www.moonsoft.es
you can see how multiple option is recovered at the example
Recover selected values from all input types
Some quick tips:
For multiple option, what you get is an array of values, so
$multiple[0] would be the first value selected
$multiple[1] the second, etc.
if you need to know how many options are selected
count($multiple)
will give you the number.
And finally
$result=0;
for($i=0;count($multiple)>$i;$i++){
$result=$result+$multiple[$i];
}
Will add at the $result every value selected (if numeric).
Hope this helps
Edited by MSTeam - 28.10.2013 19:55
Moonsoft Team
www.moonsoft.es
Re: Multiple option value 28.10.2013 20:02
Hello,
I'm not a developer and I spent a hole day to try to understand Calc Builder but no results for me
I want something like this
Multiple option
Analysis:
-- Option1 (that have cost 50 + comment: come at 7AM)
-- Option2 (that have cost2 70 + comment2: come at 8AM)
-- Option3 (that have cost3 80 + comment3: come at 9AM)
Radio button
-- Option1 (that don't give a discount)
-- Option2 (that change price to -5$ or 5% for example)
Output :
You choose :
(radio option) Option2
Toy choose : (multiple choice)
option 1 costs 50$ -5$ = 45$ (you should come at 7AM)
option 3 costs 80$ -5$ = 75 $ (you should come at 9AM)
Total cost : 120 $
Best regards
Edited by moon_1301 - 28.10.2013 20:03
I'm not a developer and I spent a hole day to try to understand Calc Builder but no results for me
I want something like this
Multiple option
Analysis:
-- Option1 (that have cost 50 + comment: come at 7AM)
-- Option2 (that have cost2 70 + comment2: come at 8AM)
-- Option3 (that have cost3 80 + comment3: come at 9AM)
Radio button
-- Option1 (that don't give a discount)
-- Option2 (that change price to -5$ or 5% for example)
Output :
You choose :
(radio option) Option2
Toy choose : (multiple choice)
option 1 costs 50$ -5$ = 45$ (you should come at 7AM)
option 3 costs 80$ -5$ = 75 $ (you should come at 9AM)
Total cost : 120 $
Best regards
Edited by moon_1301 - 28.10.2013 20:03
Re: Multiple option value 28.10.2013 20:32
Hi,
already answered at the helpdesk, please check your ticket regarding this issue. We can continue there if you have further questions because it's easier to share code.
In case it may help others, in case you need to check if one value has been selected at a multiple option, here is the code needed, let's say the multiple field is called 'multiple', and you want to check if value 'VALA' has been selected:
if (in_array("VALA", $multiple)) {
//your code here.VALA has been selected
}
Regards
Moonsoft Team
www.moonsoft.es
already answered at the helpdesk, please check your ticket regarding this issue. We can continue there if you have further questions because it's easier to share code.
In case it may help others, in case you need to check if one value has been selected at a multiple option, here is the code needed, let's say the multiple field is called 'multiple', and you want to check if value 'VALA' has been selected:
if (in_array("VALA", $multiple)) {
//your code here.VALA has been selected
}
Regards
Moonsoft Team
www.moonsoft.es