Modal in a Contact Form

I have a contact form that displays a Privacy Policy button, in the form, clicking it opens a modal showing the policy.

The interesting problem is that a click on this button causes the form to be submitted if it is populated with data. Nothing happens if there is no data in the form and the modal opens.

At first, I thought I had mistakenly placed the privacy button inside the Submit component, but that is not the case.

It looks like I cannot place a modal within a form, correct?

sounds like a bug, could you provide the project file so I can investigate further? :slight_smile:

I’ll put together a test project and post the link when it is ready.

BTW, if you want to test this on a live site, go to the following link and give it a try.

To see the bug you have to populate the form with data and then press the Privacy Policy button.

@ben Here is a test project that I created to demonstrate the problem.

elementsapp://downloadDocument/s2TsyKv6lmga

NOTE: The form settings have not all been populated so this will always fail, but it still demonstrates the problem. Fill out all of the fields with data and then click on the Privacy Policy button. This will attempt to submit the form while opening the modal. If there is no data in the form then the modal will simply open. I have no idea if in this case it attempts to do a submit, I assume not because no error is generated.

Hope this helps.

@ben Is there any news on this bug, as I need to make this modal work in my form somehow, so that user don’t accidently send out the form before they are ready.

I’ve not been able to prioritise this fix, unfortunately. I can’t promise anything, but I’ll try and get a few of these types of fixes in to the next beta (or two) :slight_smile:

1 Like