When we creating a webform with select options, it gives the list with our options and '-None-' as the default empty value. If i choose it as a mandatory field it changes to '-Select-'. Recently a client of mine wants me to rename the '-None-' as '-Please Select-'. There is no way you can do that with the webform module. There comes an idea of implementing hook_form_alter.
Thats it!!
- function yourmodule_form_alter(&$form, &$form_state, $form_id) {
- if ($form_id == 'webform_client_form_your_webform_id') {
- $form['submitted']['component_name']['#default_value'] = '';
- $form['submitted']['component_name']['#empty_value'] = '';
- $form['submitted']['component_name']['#empty_option'] = '- Please Select -';
- }
Hi Dhinesh,
ReplyDeleteSearched for this one. Excellent !! it works. Thank you very much. Chumma kalakiteenga ponga.....
I'm happy that it works for you!
Delete