Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1333635
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this questionI had A custom PHP template for wpForm. there is checkbox for multiples value selection as stated in my template. When I Submit, the form will trigger "add_action( 'wpforms_process_complete', 'sendData', 10, 4 );" . And I would like to check the value and modify as I need to pass to external service via json. How can I get "Checked" value?
This is my template code:
public function init() {
// Template name
$this->name = 'Registration';
// Template field and settings
$this->data = array (
'field_id' => 14,
'fields' => array (
2 => array (
'id' => '2',
'type' => 'name',
'label' => 'Company Name',
'format' => 'simple',
'required' => '1',
'size' => 'large',
)
11 => array (
'id' => '11',
'type' => 'checkbox',
'label' => 'Options',
'choices' => array (
1 => array (
'label' => 'delivery',
),
2 => array (
'label' => 'walk-in',
)
),
'required' => '1',
'choices_images_style' => 'modern',
'input_columns' => 'inline',
),
);
}
This is my submit triggered function :
add_action( 'wpforms_process_complete', 'sendData', 10, 4 );
function sendData( $fields, $entry, $form_data, $entry_id) {
//The JSON data.
$jsonData = array(
'companyName' => $fields['2']['value']
'option' => $fields['11']['value']
);
}
本文标签: phpWordPress wpform plugin submit and get multiple checked value from checkbox
版权声明:本文标题:php - WordPress wpform plugin submit and get multiple checked value from checkbox 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742357854a2459774.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论