Hiding mandatory form fields in an experience | Community
Skip to main content
Level 2
March 4, 2025
Solved

Hiding mandatory form fields in an experience

  • March 4, 2025
  • 2 replies
  • 821 views

Very simple question, but I was not able to find an answer: when working with a form embedded on a webpage, can I hide a mandatory field and still allow the visitor to submit the form, without changing the form in the backend? 

Best answer by Vaibhav_Mathur

Hi @floriana_guardi , 

 

The best possible solution for this would be hiding the mandatory field and filling in some dummy values in that mandatory field using JS which will not be visible to the end user but it will allow them to submit the form. 

 

I hope it helps. 

 

Best regards, 

Vaibhav Mathur

2 replies

maccg12
Level 3
March 4, 2025

This would be problematic. While Adobe Target could be used to hide or remove said form fields using CSS or JS, if the form is configured to require those fields on the backend, simply hiding them on the front end wouldn't allow submission unless there's additional intervention to bypass validation. Mandatory fields are usually required for a reason (i.e. compliance, business logic, etc.), so removing them could result in incomplete or inaccurate data collection. If not handled properly, visitors might encounter unexpected validation errors when trying to submit the form.

Vaibhav_Mathur
Community Advisor
Vaibhav_MathurCommunity AdvisorAccepted solution
Community Advisor
March 5, 2025

Hi @floriana_guardi , 

 

The best possible solution for this would be hiding the mandatory field and filling in some dummy values in that mandatory field using JS which will not be visible to the end user but it will allow them to submit the form. 

 

I hope it helps. 

 

Best regards, 

Vaibhav Mathur

maccg12
Level 3
March 6, 2025

I'd be very careful of hiding the fields and inserting "dummy values" because if these fields are mandatory, it's likely because the business relies on them for processing, reporting, compliance, or personalization. Dummy values could have the unintended consequence of corrupting the dataset, making analytics, automation, and decision-making unreliable.

Level 2
March 7, 2025

Thank you for the feedback, those are all very good points!

 

In our case, we're working with the form owners directly: they want to A/B test the impact of removing certain mandatory fields to understand if the benefits of simplifying the flow offset the drawbacks of not having that info in the CRM upon first form submission (they could be added in a second step after a form lead is qualified). It's also a new CRM system, so we're still in the initial phase, and we don't have automated processes that could be impacted.