Skip to content

Instantly share code, notes, and snippets.

@sazzadh
Created May 9, 2019 20:31
Show Gist options
  • Save sazzadh/873acdeef6b9d0e7da981f4ff94cc39e to your computer and use it in GitHub Desktop.
Save sazzadh/873acdeef6b9d0e7da981f4ff94cc39e to your computer and use it in GitHub Desktop.
{% assign f = current_site.find_form[section.settings.form] %}
{% if f %}
{% assign labelStyle = section.settings.style %}
{% if labelStyle == "label" %}
{% assign use_label = true %}
{% assign use_placeholder = false %}
{% else %}
{% assign use_label = false %}
{% assign use_placeholder = true %}
{% endif %}
{% form f %}
{% assign btnId = 'btn_text' | settings_id: section: section %}
{% assign btnText = section.settings.btn_text %}
{% assign formStyle = "flush" %}
<div class="section--middle optin__panel optin__panel--{{ formStyle }}" kjb-settings-id="{{ 'form' | settings_id: section: section }}">
<input type="hidden" name="thank_you_url" value="{{ section.settings.thank_you_url }}">
{% for field in f.fields %}
{{ field | form_input: class: "form-group", input_class: "form-control", label: use_label, placeholder: use_placeholder }}
{% endfor %}
<div class="pf4_form_button_holder">
<button class="btn btn--{{btnId}} btn--{{btnWidth}} btn--{{btnStyle}} btn-form" id="form-button" type="submit" kjb-settings-id="{{btnId}}">{{btnText}}</button>
</div>
</div>
{% endform %}
{% else %}
{% if editor %}
<div class="editor-null" kjb-settings-id="{{ 'form' | settings_id: section: section }}">
<h5>Heads up! You have not selected a form yet.</h5>
</div>
{% endif %}
{% endif %}
{% schema %}
{
"name": "Form Example",
"elements": [
{
"type": "header",
"content": "Form",
"style": "subheading"
},
{
"type": "form",
"id": "form",
"label": "Form",
"info": "Select the form you wish to use on this Landing Page. If you are new to opt in forms you can learn more [here](what_is_opt_in)",
"default": "default",
"allow_blank": true
},
{
"type": "action",
"id": "thank_you_url",
"label": "Thank You Page",
"info": "Leave this field blank to go to the default thank you page."
},
{
"type": "text",
"id": "btn_text",
"label": "Button Text",
"default": "Submit"
},
{
"type": "header",
"content": "Form Appearance",
"style": "subheading"
},
{
"type": "radio",
"label": "Input Label",
"id": "style",
"default": "placeholder",
"options": [
{ "label": "Placeholder", "value": "placeholder" },
{ "label": "Label", "value": "label" }
]
}
],
"presets": [
{
"name": "Form Example",
"category": "Content"
}
]
}
{% endschema %}
@kinirinesh
Copy link

Hello,

can anyone tell me how to retrieve custom form fields value in kajabi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment