views:

17

answers:

0

I am trying to get this code to work with another form element...

if($error != ' field is required.') {
    //print 'in field is required<br>';
    $_SESSION['err_counter'] = $_SESSION['err_counter'] + 1;
    //print 'error counter = '. $_SESSION['err_counter'] . '<br>';
    $idx = array_search($error, $_SESSION['messages']['error']);
    if ($idx !== FALSE) {
        unset($_SESSION['messages']['error'][$idx]);
        //print 'in $idx != FALSE<br>';
        $output .= "<div class = 'messages error'>" . $error . "</div>";
    }
    $idx = array_search('Please correct all highlighted items and try again.', $_SESSION['messages']['error']);
    if ($idx === FALSE) {
      drupal_set_message('Please correct all highlighted items and try again.', 'error');
    }
    if($_SESSION['err_counter'] == 1) {
       //print '(in set_message)<br>';
       drupal_set_message('Review the form below for additional information.', 'error');
    }

related questions