I have created a contact form by using webform module, in that I have added one component as reset
and the type is select options
.
My requirement is when I choose this reset option from that dropdown and submitted the form, I want to reset my form. I have no idea how can I achieve this. I tried following but not worked, please help me regarding this.
function test_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'webform_client_form_111') { $form['submitted']['reset']['#option'] = 'test_reset'; } } function test_reset(&$form, &$form_state){ $form_state['rebuild'] = FALSE; }