I’m doing some address validation using a webservice in the background.
When the user enters e.g. a street name that’s not quite correct, the backend makes a single suggestion.
I’d like to place the “corrected” street name into the field for street in the form itself and do a form_set_error too, to highlight the field with a message.
The idea is that the user can then accept or overwrite the value.
So much for the use case.
I’ve tried doing this in the validation part as follows:
$form['street']['#parents'] = array('street'); form_set_value($form['street'],t('tjoohooo222'), $form_state);
and also followed this with (also tried without this)
$form_state['rebuild'] = TRUE;
But the form I return to still has the original value in it.
At least – it displays the original value
Dumping form_state I can see the the value for the field is set to the new value, but the “input” value is still the old one.
[input] => > Array ( [firstname] => ss [street] => myer ... [values] => > Array ( [firstname] => ss [street] => tjoohooo222 ...
What am I missing to change the “input” value displayed to the user in the form itself.