First version for supporting select and checkboxes