By: Quati
Date: 2006-04-05
Time: 00:32
|
Dynamic CheckboxesSorry, but I search the forum for this topic, and the examples that are listed, doesn't work for me.
I need to create dynamic checkboxes with values from an array. A stupid example: the array comes with:
I want to create four dynamic checkboxes with that values. Something like:
When I tried this, it only create the FIRST checkboxes (apple) and nothing more. The result must be: [ ] Apple [ ] Orange [ ] Lemon [ ] Banana How I can do that? Thanks. |
||
By: Sheepy
Date: 2006-04-05
Time: 12:43
|
Re: Dynamic CheckboxesYou need to make it a block:
<input type='checkbox' value='[blkFruits.val;block=input]' name='Fruits[]'>[blkFruits.val]</input> Make sure you use MergeBlock instead of MergeField |
||
By: Quati
Date: 2006-04-06
Time: 20:47
|
Re: Dynamic CheckboxesHi! This worked.
BUT, It shows the result: [ ] apple [ ] orange [ ] lemon [ ] banana And I need a <BR> after each checkbox... How can I do it? Thks |
||
By: Quati
Date: 2006-04-06
Time: 20:55
|
Re: Dynamic CheckboxesI MADE IT! :)
Here, the solution of the problem.
|
||
By: Quati
Date: 2006-04-07
Time: 00:17
|
Re: Dynamic CheckboxesOk. Now Im having ANOTHER problem.
I need to check if the checkbox is SELECTED or NOT. What is the situation: I have the group of checkboxes (the fruits as mention) and I have another array with the fruits that are selected.
I need to make a function each time that the input code is created to verify if the input is selected or not, by doing a comparation between the input value just created (for example, the 'Apple' value) to the $selected_array. If the value exists in the $selected_array, so the checkbox is SELECTED, else NOT. What can I do? I really try to find out this answer in the manual, but cant find it... Thanks. |
||
By: Sheepy
Date: 2006-04-10
Time: 05:49
|
Re: Dynamic CheckboxesA hint: look at the 'multi-selection' part of this parameter's doc. ^_^
http://www.tinybutstrong.com/manual.php#html_field_prm_selected You can also try the 'List, radio and checkbox' examples. |