Ken Ng Posted June 26, 2015 Report Posted June 26, 2015 Hi guys, I need help on how to use select dropdown instead of checkbox on lookup.pdt <div class="form-group tlds"> <?php foreach ($tlds as $tld=> $pack) { ?> <label class="checkbox-inline"> <?php $this->Form->fieldCheckbox("tlds[]", $tld, in_array($tld, $this->Html->ifSet($vars->tlds, array()))); ?> <?php $this->Html->_($tld);?> </label> <?php } ?> </div> Any help/advice would be great. Quote
0 Tyson Posted June 26, 2015 Report Posted June 26, 2015 Something like this I presume <?php $this->Form->fieldSelect("tlds[]", $this->Html->ifSet($vars->tlds, array()), $tld)); ?> Michael 1 Quote
0 Ken Ng Posted June 27, 2015 Author Report Posted June 27, 2015 Thanks for the reply. And because it is under foreach, all tlds became a select if I use fields elect. How can I use it in foreach and make sure all tlds is labeled as option. Quote
0 Blesta Addons Posted July 4, 2015 Report Posted July 4, 2015 I want to help . But every time i forget it . I will try this weekend to do it for you . As i imagine is not a hard task . Quote
0 Blesta Addons Posted July 4, 2015 Report Posted July 4, 2015 <div class="form-group tlds"> <?php $ext = array(); foreach ($tlds as $tld => $pack) { $ext[$tld] = $tld ; } $this->Form->fieldSelect("tlds[]", $this->Html->ifSet($ext), $this->Html->ifSet($vars->tlds)); ?> </div> Ken Ng and activa 2 Quote
0 Ken Ng Posted July 6, 2015 Author Report Posted July 6, 2015 Thanks mate! That would save us (Designer) alot of time! activa and Blesta Addons 2 Quote
Question
Ken Ng
Hi guys,
I need help on how to use select dropdown instead of checkbox on lookup.pdt
Any help/advice would be great.
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.