function tripal_core_content_type_toc_form_validate
2.x tripal_core.toc.inc | tripal_core_content_type_toc_form_validate($form, &$form_state) |
3.x tripal_core.toc.inc | tripal_core_content_type_toc_form_validate($form, &$form_state) |
Implements hook_validate for the tripal_core_node_toc_form.
File
- tripal_core/
includes/ tripal_core.toc.inc, line 755
Code
function tripal_core_content_type_toc_form_validate($form, &$form_state) {
$toc_items = $form_state['values']['toc_items'];
// Iterate through the TOC items and validate.
foreach ($toc_items as $toc_id => $item) {
if (!$item['title']) {
form_set_error('toc_items][' . $toc_id, "Please provide a valid title.");
}
}
}