I am trying to change the value of a text area field at the end of my submit handler. I have tried using form_set_valu
e and $form['form_id']['#value'] = 'something';
to accomplish this but after clicking the submit button the field never changes. Also the submit button that I am trying to change the field with comes from the file managed form. I also included $form_state['rebuild'] = true;
after I set the field's value. Here is my code
function my_module_my_form_submit($form,&$form_state) {
//do something with then file code
...
then
$form_set_value($form['value_to_change'], 'update the value, $form_state);
//I also tried
$form['value_to_change']['#value'] = 'update the value';
$form_state['rebuild'] =TRUE
}
In the form my code is
$form['value_to_change'] = array(
'#type' = 'text area',
'#value' => 'this will change',
);
$form_state['values']['YOURFIELD']
it should be working – Nikhil M Jun 4 at 2:01