How do I insert multiple checkbox values into a table?

You should specify <input type=”checkbox” name=”Days[]” value=”Daily”>Daily<br> as array. Add [] to all names Days and work at php with this like an array. After it, you can INSERT values at different columns at db, or use implode and save values into one column. Didn’t tested it, but you can try like this. Don’t forget … Read more

How to use in or to select multiple items?

Your best bet is to bind the <h:selectBooleanCheckbox> value with a Map<Item, Boolean> property where Item represents the object behind the corresponding row. <h:dataTable value=”#{bean.items}” var=”item”> <h:column> <h:selectBooleanCheckbox value=”#{bean.checked[item]}” /> </h:column> … </h:dataTable> <h:commandButton value=”submit” action=”#{bean.submit}” /> public class Bean { private Map<Item, Boolean> checked = new HashMap<Item, Boolean>(); private List<Item> items; public void submit() … Read more

tech