Is There any Harm in Eliminating the Submit Button Code Completely from Customize > HTML?

By: Mark Hansen | Asked: 12/23/2024
ForumsCategory: General questionsIs There any Harm in Eliminating the Submit Button Code Completely from Customize > HTML?
Mark HansenMark Hansen asked 23 hours ago
Basically, the question. 

I have many forms I use to help people calculate things. The submit button is never used, since it's all handled within the form itself without needing to be submitted. Previously, I added a hidden field with a word in it and conditionally hid the form button based on that word.  I'm in a market where lead generation is common and have dabbled in it myself many times, but no longer do so and want no trail of "send your information" on forms, due to the new FTC 1-1 consent rules coming out.  Is there any harm in simply removing the html code for the form button field on the customizer setting?
1 Answers
Best Answer
Rob LeVineRob LeVine answered 22 hours ago
I don't see how that would cause a problem (famous last words). Another way you could handle it is to set the form to "Do not store entries submitted from this form" and leave the button as is, thus allowing you to use the redirection and confirmations messages that come with submitting.
Mark HansenMark Hansen replied 22 hours ago

Thanks, Rob. I don't store entries on any of these forms so there's no need for the button at all. I've hidden many of them using a hidden field with a value, then a conditional. Now I just want to pull the button completely to remove it from the underlying code. I tested it in several ways and don't see any errors in the console, so I assume it must be working fine.

Appreciate the reply! Thanks and happy holidays!

Rob LeVineRob LeVine replied 22 hours ago

I looked a little further into it and discovered some interesting, albeit irrelevant things. A) When I removed ALL of the HTML code in the button's section on customize HTML page, the button showed up anyway. I've noticed that before as I think it's an FF fail-safe thing. B) If I delete all the HTML code between the outer DIV, it's fine. C) Knowing that the return key will also submit the form unless you add jQuery to suppress it, I also looked into that and noted that if instead of removing the HTML from the customize page I set its css class to frm_hidden, the button doesn't show up, but if you hit ENTER/RETURN in one of the text fields, the form submits anyway. So my conclusion is that the only way to do it is to remove the HTML code between the DIVs. That and $4 will get you a cup of coffee.

Mark HansenMark Hansen replied 22 hours ago

Haha - You tested much farther than I did! Thank you for that, and I'll revisit those in which I pulled it out completely. 99% of them were already hidden by the hidden field conditional, so I wasn't seeing them to begin with. I'll send that new task over to my trusty helper and let her rip on it.

Thanks again and Happy Holidays!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right