function fillpdf_field_edit_validate in FillPDF 6        
                          
                  
                        Same name and namespace in other branches
- 5 fillpdf.module \fillpdf_field_edit_validate()
 
 
File
 
   - ./fillpdf.admin.inc, line 659
 
  - Allows mappings of PDFs to site content
 
Code
function fillpdf_field_edit_validate($form, &$form_state) {
  if (db_result(db_query("SELECT * FROM {fillpdf_fields} WHERE fid = %d AND pdf_key = '%s'", $form['#pdf_form']->fid, $form_state['values']['pdf_key']))) {
    if ($form['#pdf_field'] && $form['#pdf_field']->pdf_key == $form_state['values']['pdf_key']) {
      return;
    }
    else {
      form_set_error('pdf_key', t('A field with this pdf_key already exists. Choose another pdf_key.'));
    }
  }
}