drupal-webform

How to replace field value in a Drupal Webform's validator?

痴心易碎 提交于 2021-02-08 04:46:52
问题 In a Drupal Webform, I'd like to alter the submitted value (e.g. to strip any non-numeric character) when going through the validator. I follow the validator readme to add in hook_webform_validation_validators and implement the hook_webform_validation_validate hook. However I cannot locate a return parameter to alter the submitted webform value. For example, if a user enters $12,340 , I'd like to fail the submission and update the webform value to 12340 .When the user submits the second time,

Drupal - Webforms as Block - Modifying Action

家住魔仙堡 提交于 2020-01-06 07:01:48
问题 I am using Drupal 7.15, and have a Webform setup as a block that gets included on the Contact page (a basic page). The basic Contact page has editable sidebar content and then the Webform block as the main content. The problem I am having is on submission the Webform goes to its own alias 'general-inqueries' rather than the Contact us alias 'contact-us'. I want it to return to the basic page Contact Us with any validation errors and/or confirmation message. It seems the form action is always

Drupal - Webforms as Block - Modifying Action

[亡魂溺海] 提交于 2020-01-06 07:01:32
问题 I am using Drupal 7.15, and have a Webform setup as a block that gets included on the Contact page (a basic page). The basic Contact page has editable sidebar content and then the Webform block as the main content. The problem I am having is on submission the Webform goes to its own alias 'general-inqueries' rather than the Contact us alias 'contact-us'. I want it to return to the basic page Contact Us with any validation errors and/or confirmation message. It seems the form action is always

Drupal - Webforms as Block - Modifying Action

北城余情 提交于 2020-01-06 07:01:26
问题 I am using Drupal 7.15, and have a Webform setup as a block that gets included on the Contact page (a basic page). The basic Contact page has editable sidebar content and then the Webform block as the main content. The problem I am having is on submission the Webform goes to its own alias 'general-inqueries' rather than the Contact us alias 'contact-us'. I want it to return to the basic page Contact Us with any validation errors and/or confirmation message. It seems the form action is always

Using Hook_form_alter on webform submitted values

泪湿孤枕 提交于 2019-12-13 03:56:52
问题 Drupal 7. Webforms 3.x. I am trying to modify a webform component value on submit. I made a custom module called 'mos' and added this code to it. function mos_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'webform_client_form_43') { dsm($form['#node']->{'webform'}['components']['1']); $form['#submit'][] = 'mos_contact_us_submit'; } } function mos_contact_us_submit($form, &$form_state) { $form['#node']->{'webform'}['components']['1'] = 'working@mos.com'; } However when I look at

How and where to write Webform submit hook?

牧云@^-^@ 提交于 2019-12-07 07:32:41
问题 I am new to Drupal(7) and hence need some help for following situations. I have created one Webform(I have other webform too) and now instead of inserting in default webform_submitted_data table, I want for this webfrom to insert into myTable. From what I found, I need to write a hook for this. Actually I am getting confused for way to write this hook. I have below questions. Where to write this hook (in which file). How to write this hook only for one webform. Please help and let me know if

How and where to write Webform submit hook?

依然范特西╮ 提交于 2019-12-05 11:50:28
I am new to Drupal(7) and hence need some help for following situations. I have created one Webform(I have other webform too) and now instead of inserting in default webform_submitted_data table, I want for this webfrom to insert into myTable. From what I found, I need to write a hook for this. Actually I am getting confused for way to write this hook. I have below questions. Where to write this hook (in which file). How to write this hook only for one webform. Please help and let me know if you need any more information for this. First, be very sure before you start twisting Drupal's arm into