Timeline for Accessible Checkboxes Using Drupal's Form API
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 10, 2013 at 1:21 | comment | added | Aiias |
Per your comment on littledynamo's answer, if you want to remove the form tag, but keep the form data you can always use something like preg_replace('#<form[^>]*>|</form>#', '', $content); . However, you are going to run into other issues with the form_build_id and form_token .
|
|
Mar 10, 2013 at 0:47 | comment | added | Aiias |
You should still be able to use drupal_get_form within your hook_block_view() . Does this work for you? $block['content'] = drupal_get_form('my_form_id');
|
|
Mar 10, 2013 at 0:40 | comment | added | Rob Holmes | yes this was the reason for the question and why form_process_checkboxes was necessary due to the use outside of the normal drupal_get_form scenario. If you return a renderable array for a block it gets run through a bog standard drupal_render() | |
Mar 10, 2013 at 0:38 | comment | added | Aiias |
After re-reading your question, it looks like you are not using drupal_get_form , so you are not following the typical Drupal form API. The for attribute will show up if the given checkbox has an #id which should be taken care of by drupal_get_form .
|
|
Mar 10, 2013 at 0:23 | history | edited | Aiias | CC BY-SA 3.0 |
Took quote from D7 FAPI
|
Mar 10, 2013 at 0:14 | comment | added | Rob Holmes | Sorry i should have specified that this is for drupal 7. The question is about the 'for' attribute for the label and not setting the label itself. The line '#options' => drupal_map_assoc(array(t('SAT'), t('ACT'))), produces an array the same as you have posted, but the situation is left where there are no ID's for the individual checkboxes and as a result no 'for' attributes applied. | |
Mar 9, 2013 at 22:55 | history | answered | Aiias | CC BY-SA 3.0 |