如何在drupal表单上红色突出显示控件,表单设置错误.而要验证的控件位于父元素的#rows属性中


How to red highlight the control on drupal forms with, form set error. while control to validate is lying in #rows attribute of parent element?

我正在执行一些验证,我写了一段代码,用于验证数组中的子元素,该数组是表单元素的子元素,并与#rows属性相关联,但我无法选择特定的控件来突出显示它给最终用户,这里的错误在于?另外,我使用drupal设置消息,我只需要突出显示代码。我在和你们分享代码。谢谢你的建议!

$form['patient_videos'] = array(
            '#prefix' => '<div class="aa-patient-videos-container">',
           '#suffix' => '</div>',
           '#tree' => TRUE,
           '#theme' => 'table',
           '#header' => array( t('Title'),
                               t('Sent Date'),
                               t('Status'),
                               t('Customize'),
                               t('Include'),
                               t('Watched'),
                               t('No. Times View'),
                               t('No. Times Sent'),
                               t('First Send'),
                               t('Resend'),
                            ),
           '#rows' => array(),
           ###  do not put #name on the form fields
        );
$form['patient_videos'][] = array(
                'title'=>&$title,
                'sent_date'=>&$sent_date,
                'status'=>&$status,
                'customize'=>&$customize,
                'include'=>&$include,
                'watched'=>&$watched,
                'number_times_viewed'=>&$number_times_viewed,
                'number_times_sent'=>&$number_times_sent,
                'first_sent_date'=>&$first_sent_date,
                'video_id'=>&$video_id,
            );
            $form['patient_videos']['#rows'][] = array(
                array('data' => &$title),
                array('data' => &$sent_date),
                array('data' => &$status),
                array('data' => &$customize),
                array('data' => &$include),
                array('data' => &$watched),
                array('data' => &$number_times_viewed),
                array('data' => &$number_times_sent),
                array('data' => &$first_sent_date),
                array('data' => &$video_id),
            );
//USING LOOP TO ACCESS EACH ROW'S VALUES 
 foreach ($form_state['values']['patient_videos'] as $key => $value){
.
.
.
}
form_set_error('$values][patient_videos][$key][email_schedule', t("You cannot enter bigger date from next video in  ").$g);

如何选择每行发送的日期控件,并在value不为true时突出显示它。d

试试内联表单错误模块