简体   繁体   中英

How to get drupal webform module submitted value programmatically?

I want to get the Webform submitted value using Webform module API.

How can I do that?

自定义编码:添加高级验证或提交代码 -通过print_r或dsm(开发模块)研究$ form_state结构,并在mywebform_extra_submit_44函数中找到您提交的数据。

Here is how I did it, the form was just an email address.

function mymodule_webform_submission_insert($node, $submission)
{
  $value = array_shift($submission->data);
  $value = array_shift($value['value']);
  //$value is now the first value entered (in the case of multi-entry fields) or only value entered
}

Both node and submission are stdClass objects.

(Done in drupal 6)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM