CMS Development

ben-duchy
Top Contributor

Simplifying form usage

SOLVE

Is it possible within a custom web module to show / hide info if a certain field within a form matches the contents of a custom field within the web module?

 

Currently when I select a form within the web module it displays set info (example below). How do I write an if condition based on the first name field which isn't shown in the code?

 

{% form
	form_to_use="{{ module.form_field.form_id }}"
	response_response_type="{{ module.form_field.response_type }}"
	response_message="{{ module.form_field.message }}"
	response_redirect_id="{{ module.form_field.redirect_id }}"
	response_redirect_url="{{module.form_field.redirect_url}}"
	gotowebinar_webinar_key="{{ module.form_field.gotowebinar_webinar_key }}"
%}

 

0 Upvotes
1 Accepted solution
BarryGrennan
Solution
Top Contributor

Simplifying form usage

SOLVE

Hi Ben, 

 

Depending on your account level you can natively use dependent form fields

Failing that you'd likely need to use a javascript solution targeting the specific input by name and triggering something to show on change/keyup, etc.

View solution in original post

3 Replies 3
ben-duchy
Top Contributor

Simplifying form usage

SOLVE

Hi @BarryGrennan,

 

You're right, JS / bespoke API will probably be required for my use case as I would like to go beyond my original example and potentially change the email it sends the answers to based on a custom object field. I'll take a look, but I think the dependent form field will be too basic for my needs.

0 Upvotes
BarryGrennan
Top Contributor

Simplifying form usage

SOLVE

For the different emails part you could probably use workflows with the trigger being Form Submission and filter by contact property (again, depends on account level)

0 Upvotes
BarryGrennan
Solution
Top Contributor

Simplifying form usage

SOLVE

Hi Ben, 

 

Depending on your account level you can natively use dependent form fields

Failing that you'd likely need to use a javascript solution targeting the specific input by name and triggering something to show on change/keyup, etc.