简体   繁体   中英

I want every option accept two or more value with php in HTML

here is the code

 <div class="form-group">
                    <label class="col-md-3 control-label">Privilege Type:</label>
                    <div class="col-md-3">
                        <select style="width: 210px;" name="data[CreditCard][privilege_type][]" multiple='true'>
                            <option value="">Select Privilege Type</option>
                            <option value="Air miles">Air miles</option>
                            <option value="Cashback">Cashback</option>
                            <option value="Airport lounges">Airport lounges</option>
                             <option value="Dining">Dining</option>
                              <option value="Shopping">Shopping</option>
                        </select> 
                        <p>Press Ctrl to select more than one privilege type</p>
                    </div>
                </div>

for example i want option 3 accept Air miles also Airport lounges together in the same option

  <div class="form-group"> <select class="form-control" id="sel1"> <option value=""><?php echo __('All Priviliges'); ?></option> <option value="Air miles"><?php echo __('Air Miles'); ?></option> <option value="Airport lounges"><?php echo __('Airport Lounges'); ?></option> <option value="Dining"><?php echo __('Dining'); ?></option> <option value="Shopping"><?php echo __('Shopping'); ?></option> <option value="cashback"><?php echo __('CashBack'); ?></option> </select> </div> 

I think you should be using check boxes, my friend.

Selects are made to receive only one input.

I did find this post, however, using a simple google search.....

Can an Option in a Select tag carry multiple values?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM