function merci_cpm_autocomplete_validate in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3
1 string reference to 'merci_cpm_autocomplete_validate'
- merci_cpm_field_widget_commerce_customer_profile_type_ui_manager_form_alter in merci_cpm/merci_cpm.module
File
- merci_cpm/merci_cpm.module, line 98
Code
function merci_cpm_autocomplete_validate($element, &$form_state, $form) {
evergreen_erp_autocomplete_validate($element, $form_state, $form);
if (!array_key_exists('autocomplete_profile_id', $form_state) or empty($form_state['autocomplete_profile_id'])) {
$name = drupal_array_get_nested_value($form_state['values'], $element['#parents']);
$matches = array();
$result = preg_match('/\\[([0-9]+)\\]$/', $name, $matches);
if ($result > 0) {
$form_state['autocomplete_profile_id'] = $matches[$result];
}
}
}