Browse Source

updated validation so missing title is only triggered on submit not on doi lookup

9.x-1.0
Paul Pound 8 years ago
parent
commit
bb4e4414c4
  1. 8
      includes/form.inc

8
includes/form.inc

@ -48,10 +48,8 @@ function upei_roblib_ill_form_validate($form, &$form_state) {
$form_state['storage']['aid'] = $aid; $form_state['storage']['aid'] = $aid;
} }
} }
if ($form_state['step'] == 'upei_roblib_ill_request_form' && empty($form_state['values']['doi']) && empty($form_state['values']['Title']) && if ($form_state['step'] == 'upei_roblib_ill_request_form' && $form_state['triggering_element']['#value'] !== 'lookup DOI' && empty($form_state['values']['Title'])) {
empty($form_state['values']['ArticleTitle']) form_set_error('Title', t('Source Title is required.'));
) {
form_set_error('Title', t('One of "DOI", "Title" or "Article Title" values must be provided'));
} }
} }
@ -301,7 +299,7 @@ function upei_roblib_ill_request_form($form, &$form_state) {
'#default_value' => upei_roblib_ill_get_request_variable('title'), '#default_value' => upei_roblib_ill_get_request_variable('title'),
'#description' => 'Journal or Book Title', '#description' => 'Journal or Book Title',
'#size' => 50, '#size' => 50,
'#required' => TRUE, '#required' => FALSE,
); );
$form['ArticleTitle'] = array( $form['ArticleTitle'] = array(
'#type' => 'textarea', '#type' => 'textarea',

Loading…
Cancel
Save