function chado_add_node_form_properties_add_button_validate
2.x tripal_core.chado_nodes.properties.api.inc | chado_add_node_form_properties_add_button_validate($form, &$form_state) |
3.x tripal_core.chado_nodes.properties.api.inc | chado_add_node_form_properties_add_button_validate($form, &$form_state) |
Validate the user input for creating a new property Called by the add button in chado_add_node_form_properties
1 call to chado_add_node_form_properties_add_button_validate()
- chado_add_node_form_subtables_add_button_validate in legacy/
tripal_core/ api/ tripal_core.chado_nodes.api.inc - Validate Adding Subtables entries from the node forms. Supported subtables: Properties, Relationships, Additional DBxrefs.
File
- legacy/
tripal_core/ api/ tripal_core.chado_nodes.properties.api.inc, line 650 - API to manage the chado prop table for various Tripal Node Types
Code
function chado_add_node_form_properties_add_button_validate($form, &$form_state) {
// Ensure the type_id is supplied & Valid
$cvterm = chado_select_record(
'cvterm',
array('cvterm_id', 'name', 'definition'),
array('cvterm_id' => $form_state['values']['property_table']['new']['type'])
);
if (!isset($cvterm[0])) {
form_set_error('property_table][new][cvterm', 'Please select a property type before attempting to add a new property.');
}
else {
$form_state['values']['property_table']['new']['type_name'] = $cvterm[0]->name;
$form_state['values']['property_table']['new']['definition'] = $cvterm[0]->definition;
}
// Ensure value is supplied
if (empty($form_state['values']['property_table']['new']['value'])) {
form_set_error('property_table][new][value', 'You must enter the property value before attempting to add a new property.');
}
}