how to get checkbox array value in drupal

Events happening in the community are now at Drupal community events on www.drupal.org.
mayur.pimple's picture

Hi
I had create form in drupal.

function cblocks_page_form() {

$form['item'][$i]['iselect'] = array(
'#type' => 'checkbox',
'#return_value' => $key[$i]['id'],
'#attributes' => array('class' => 'checkb'),
'#required' => TRUE,
'#prefix' => '

<

div class="irowl">');
return $form;

}

so i had create multipal checkbox.
so how to get multipal checkbox values from form.

Thanks
Mayur

Comments

got the solution

mayur.pimple's picture

$form['item'][$i]['iselect[]']
array is pass in iselect in name.
and get value from $id=$_POST['iselect']

use #type as checkboxes

nagwani's picture

Try and use #type as checkboxes and pass and array to the value param...To get all checked ones would be a cakewalk

thanks Prafful

mayur.pimple's picture

thanks

Bangalore

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week