WIP: Required Fields with custom name attribute value and Form Data type throws error

Browser: Chrome 150.0.7871.188
OS: Windows
URL: Form Bug – Adnan Shafi

This bug only happens when I add a custom value to the name attribute on the native Bricks Builder Form AND set it to required. Setting that custom name value field to required always returns an error when submitting as if I did not fill the fields. But as soon as I disable the required toggle, the submission goes through successfully.

To bypass this issue, I thought why not format a custom payload for the webhook which is exactly what I did, but there is a problem there too.

When data format is set to JSON, it is fine, but when I set it to Form data, I get errors, the submission never happens and here’s what I see in console:

bricks.min.js?ver=1785758127:1 
 POST https://adnanshafi.com/wp-admin/admin-ajax.php 500 (Internal Server Error)
bricksSubmitForm	@	bricks.min.js?ver=1785758127:1
(anonymous)	@	bricks.min.js?ver=1785758127:1

My payload is formatted like this:
{
“entry.1244623032”: “{{bbd65b}}”,
“entry.981485556”: “{{aedce8}}”
}

Setting the data type to Form Data is crucial as many platforms need that formatting such as Mautic and Google Forms.

Please let me know if I am doing something wrong or if it is a genuine bug.

Hi,

can you copy the form element and paste it here (inside triple backticks), so I can exactly check the form that is not working for you?
Because I tried to replicate it locally but was not successful.

Thank you,
Matej

{"content":[{"id":"ncrotp","name":"form","parent":"cmrxat","children":[],"settings":{"fields":[{"type":"text","label":"Name","placeholder":"Your Name","id":"bbd65b","name":"entry.1244623032","required":true},{"type":"email","label":"Email","placeholder":"Your Email","id":"aedce8","name":"entry.981485556","required":true}],"submitButtonStyle":"primary","successMessage":"Message successfully sent. We will get back to you as soon as possible.","emailSubject":"Contact form request","emailTo":"admin_email","fromName":"Adnan Shafi","emailErrorMessage":"Submission failed. Please reload the page and try to submit the form again.","htmlEmail":true,"mailchimpPendingMessage":"Please check your email to confirm your subscription.","mailchimpErrorMessage":"Sorry, but we could not subscribe you.","sendgridErrorMessage":"Sorry, but we could not subscribe you.","actions":["webhook"],"webhooks":[{"id":"mqumok","name":"Google","url":"https://docs.google.com/forms/u/0/d/e/1FAIpQLSe5UY2DnSmbTM0u3GyN7mc1h69qM6_GRxiAELeij-lRyRblGQ/formResponse?embedded=true"}]},"themeStyles":[]}],"source":"bricksCopiedElements","sourceUrl":"https://adnanshafi.com","version":"2.3.10"}

This Form does not work.

Neither does this one:

{"content":[{"id":"ipbahv","name":"form","parent":"lkkplr","children":[],"settings":{"fields":[{"type":"text","label":"Name","placeholder":"Your Name","id":"bbd65b"},{"type":"email","label":"Email","placeholder":"Your Email","id":"aedce8","required":true}],"submitButtonStyle":"primary","successMessage":"Message successfully sent. We will get back to you as soon as possible.","emailSubject":"Contact form request","emailTo":"admin_email","fromName":"Adnan Shafi","emailErrorMessage":"Submission failed. Please reload the page and try to submit the form again.","htmlEmail":true,"mailchimpPendingMessage":"Please check your email to confirm your subscription.","mailchimpErrorMessage":"Sorry, but we could not subscribe you.","sendgridErrorMessage":"Sorry, but we could not subscribe you.","actions":["webhook"],"webhooks":[{"id":"mqumok","name":"Google","url":"https://docs.google.com/forms/u/0/d/e/1FAIpQLSe5UY2DnSmbTM0u3GyN7mc1h69qM6_GRxiAELeij-lRyRblGQ/formResponse?embedded=true","contentType":"form-data","dataTemplate":"{\n  \"entry.1244623032\": \"{{bbd65b}}\",\n  \"entry.981485556\": \"{{aedce8}}\"  \n}"}]},"themeStyles":[]}],"source":"bricksCopiedElements","sourceUrl":"https://adnanshafi.com","version":"2.3.10"}

Hey @adnan,

Thanks for the report and for providing the form data. We were able to replicate these issues and added them to our internal bug tracker. We’ll update this thread once they’re fixed.

Best regards,
Matej

1 Like