Error message: "There were errors while submitting" "cannot be blank".drop-in script with custom fields

Modified on: Wed, 22 Jun, 2022 at 3:49 PM

Scope


I got a error message that custom field cannot be blank on checkout page/portal/In-app script

{"errors":[{"message":"There were errors while submitting"},{"param":"cf_occupation","message":"cannot be blank"}]}"


Summary


If this error pops up with custom fields then please follow the below steps.

By default, a new custom field will be set as ‘Use as hidden parameter’ on Checkout. Hence, to avoid this error, you can set the Custom field as Mandatory/Show to display in Checkout. You can enable this under the Fields section of the Checkout & Self-Serve Portal setting.


Solution


Navigate to Settings >> Checkout & Self-Serve Portal (under Customer-facing essentials section) >> Fields.


You will find the customer-level custom fields under Account Information and the Subscription level custom fields under Custom fields for subscription tabs respectively on the left panel. Just pick the appropriate custom field, and click the edit icon (which looks like a pen icon).


For example, we have a created a Custom field as ‘Occupation’ which by default with be 'use as hidden parameter'.



Change the status to ‘Mandatory’ or ‘Show’ as per your requirement In the checkout to avoid this error.



Then, click on ‘Publish’ for the changes to take effect on the Checkout pages. You can also use ‘Preview Checkout/Portal’ to review the updated status.


Related Links:

Error - quantity[0]: “Cannot be blank” when multi decimal support is enabled

I’m getting an error ‘card[billing_zip]: cannot be blank’ while creating a new customer via API. What should I do?

How to pass values to custom fields using in-app scripts?

Pre-filling/Passing custom fields to hosted pages (via Plan URL)

How to create a custom field for passwords?

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.
×