I have 3 fields. On blur on any of them I want to look for empty ones - if blurred one has value and any of the others does not, I want to copy value.
Obtaining value is easy, simply $form_state['triggering_element']['#value']
, but setting it elsewhere gets tricky.
Changing $form['item']['#default_value']
does not work if field is empty after user's edit. Changing $form['item']['#value']
makes Drupal ignore any further user input. Changing $form_state['values']
seems to do nothing. What is the correct approach that should work? When I'll know that, I'll be able to debug.
$form_state['input']['item'] = '...'
?$form_state['input']["properties"][$property_machine_name]['parameters']['parameters'][$language->idLanguage]['choices']
- it'll take some time to clear it ;) But I guess I should, at evening. Note - 'parameters' are doubled becouse of you, @Clive, and one of your answers ;)