how do I get to the radiobox values after submitting the form
I need to get to the color names.
1=red
2=blue
3= green
I know this description is stored next to the field in $this in ["options"], but I don't know the path to it. Or there is another way to find this value?
I need to get to the color names.
1=red
2=blue
3= green
I know this description is stored next to the field in $this in ["options"], but I don't know the path to it. Or there is another way to find this value?
but i still need to work with rate "1" and "red"
i need both for further processing in the form
i need both for further processing in the form
Hi Ernst,
You can use a few lines of custom code on submit to look up the 'extra' info you need.
Bob
You can use a few lines of custom code on submit to look up the 'extra' info you need.
Bob
I'm sorry, but I don't understand what you mean.
I write my own php codes and own javascripts in the form, but I don't know how to use them to get to the required information
I write my own php codes and own javascripts in the form, but I don't know how to use them to get to the required information
In PHP
$values = [1 => 'red', 2 => 'blue'];
return $values[$this->data('radio_group_input_name')] ?? null;
$values = [1 => 'red', 2 => 'blue'];
return $values[$this->data('radio_group_input_name')] ?? null;
I understand clearly, but I wanted to avoid entering values in two places
I did it by giving
in this example it's not so understandable, but imagine I have an event and its price:
This is enough to write it once, but when writing
it would be user unfriendly
I did it by giving
1 <span>red</span>and I control the display and calculations by working with strings
in this example it's not so understandable, but imagine I have an event and its price:
bar <span> 5 eur </span>and I need to know the price and the action.
action 1 <span> 7 eur </span>
action 4 <span> 6 eur </span>
This is enough to write it once, but when writing
5=barI would have to change those values in the radiobox and in php
7=action 1
6=action 4
it would be user unfriendly
You need to login to be able to post a reply.