
You can create a module that implements a submit function. *Note: In Drupal 7, the core jQuery Library is referenced by "jQuery", not the "$" alias The ".change()" call at the end is to trigger a change event so that your hidden field is always populated with the appropriate data.īe sure to put your code in a "jQuery( document ).ready(function() " call so that the bind is made at the right moment and so your page has finished loading. Some Javascript::jQuery for what you want: jQuery( "#my-select-field" ) Then, write some jQuery or JS to do what you want on the node that is housing your webform.ie:.After a submission, you can send users a thank-you email as we.

#SAFE KEY SOME READABLE OPTION DRUPAL WEBFORM UPDATE#
Update your content type settings (ie. Webform is the module for making forms and collecting information from users in Drupal.

Code per Node - allows you to add custom CSS/JS to content types or individual nodes The webform view created in views shows the safekey data of a select option field and I'd like it to show the 'some readable option' data.However, if you insist on having the select field change the hidden field's value and you want to do this purely through Drupal 7 front-end, then I suggest the following: Go to and download the Chaos tool suite (Ctools) module. If you like, since you want the value "First", you can even capitalize the keys, ie: First|This is some pizza Download the Webform, CTools, Views, and Token Modules Go to and download the Webform module.

Copy the themewebformmailfields() into your template.php file, and change. So your select field options would have something like: first|This is some pizza You need to theme your emails to print out the field key rather than the label. I agree with Ben.you should use the value of the select fields themselves using the syntax for the select field Options, ie "safe_key|Some readable option" (without quotes)
