admin管理员组文章数量:1291045
I want to use a multi-step form where the user enters their name in step one, then on step two the form will say "Hello, [name]" with the rest of the content and steps to follow.
Any ideas?
EDIT: I want to use data entered in step one on step 2. Reading GF documentation I think something like {[Field Name]:[field_id]} should work, but it does not. Digging further I found that this would only work once a form has been submitted already. So my question is, is there a way that will enable me to use the merge tags within the current form from data being submitted in a previous step?
I want to use a multi-step form where the user enters their name in step one, then on step two the form will say "Hello, [name]" with the rest of the content and steps to follow.
Any ideas?
EDIT: I want to use data entered in step one on step 2. Reading GF documentation I think something like {[Field Name]:[field_id]} should work, but it does not. Digging further I found that this would only work once a form has been submitted already. So my question is, is there a way that will enable me to use the merge tags within the current form from data being submitted in a previous step?
Share Improve this question edited Mar 30, 2019 at 15:17 Rowbee asked Mar 29, 2019 at 20:17 RowbeeRowbee 132 bronze badges 2- Welcome to WordPress development! Unfortunately it's unclear what you are asking as you didn't tell us what exactly you've tried so far and where you are stuck right now. Please update your question accordingly as otherwise it's just too broad. – norman.lol Commented Mar 30, 2019 at 8:59
- That is fair. I am trying to use merge tags in a multi-step form. I want to use data entered in step one on step 2. Reading GF documentation I think something like {[Field Name]:[field_id]} should work, but it does not. Digging further I found that this would only work once a form has been submitted already. So my question is, is there a way that will enable me to use the merge tags within the current form from data being submitted in a previous step? – Rowbee Commented Mar 30, 2019 at 15:15
2 Answers
Reset to default 1This is possible with Live Merge Tags, a feature of Gravity Forms Populate Anything.
If you're looking to get your hands dirty with some code, Gravity Forms has an example of how this might work with a snippet on their docs for the gform_pre_render
filter:
https://docs.gravityforms/gform_pre_render/#3-populate-field-with-values-from-earlier-page
It's pretty easy to extend the GF_Field_HTML
class to do this then register it at the gform_loaded
action. You'll want to override the get_field_input
method and where the original has this:
$content = GFCommon::replace_variables_prepopulate( $content );
your replacement should have this:
$lead = GFFormsModel::get_current_lead();
$content = GFCommon::replace_variables( $this->content, $form, $lead );
本文标签: pluginsMerge tags in multistep Gravity Form
版权声明:本文标题:plugins - Merge tags in multistep Gravity Form? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741511180a2382615.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论