Introduction to using html_checkboxes in smarty

Source: Internet
Author: User
The html_checkboxes method in smarty is used to generate multiple checkboxes and initialize which one is selected. usage in the Template: The html_checkboxes method in smarty is used to generate multiple checkboxes and initialize which one is selected.
Usage in the template:
{Html_checkboxes name = "groupid" options = $ cust_checkboxes selected = $ customer_id separator ="
"}}
Note:
If the data retrieved from the database is multiple-choice, what should be done with the checked value?
In the smarty manual, the variables in options = $ cust_checkboxes must be in the form of arrays ("key" => "value; here, the index value of the array is the value of checkbox, and the content corresponding to the index is the text displayed on the page next to the selection box.
Selected = $ customer the variable here is also a character array. if it is an array and the content in the array is the same as the index value in option, the checkbox is selected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.