Hi All,
I’d like to create a form with fields that trigger additional fields.
Example: How many children do you have? (select 1-4)
IF Response >1, Add Form Field: Name of Child 2…
Is this possible? I know that I could custom code it and embed the code but was hoping for something that is a little more seamless.
Thanks,
Here is my site Read-Only: LINK
(how to share your site Read-Only link )
sam-g
(Sam G.)
July 30, 2020, 10:50pm
2
@Quinn_Cosgrave - unfortunately I think some jQuery / JavaScript is the only way you’re going to accomplish this. If you need help let me know.
1 Like
Actually does seem possible! Here’s what I found right here on the forum: Custom, Conditional Form Creation?
1 Like
I just posted some JavaScript in another thread that might be what you need. Posting here for future readers. You can use Webflow interactions to show/hide inputs in your form, and then use the javascript from the other article to change wether or not they are required.
I found a solution! With the help of ChatGPT I created a demo project and created a quick tutorial video here.
TLDR: We want to make an input field required only when it becomes visible. The visibility of the field is controlled by the display style of a parent element.
We need a way to check if the input field is visible on the page and, if so, add the required attribute. We’ll check any input with the attribute ms-code=“required-if-visible”
Here the JavaScript you’ll need to add before the …