Disable Fluent Form Button

tdrayson

Sometimes I use Fluent Forms for things other than to submit data. For example, if I wanted to create a mortgage calculator that added numbers together. This doesn’t need a submit button.

The snippet below stops the button from being rendered on the frontend entirely. Rather than just hiding the button with CSS.

PHP

        <?php

// Disable button from rendering on frontend in Fluent Forms
add_filter('fluentform_rendering_field_html_button', function ($html, $data, $form) {
	if ($form->id != 17) {  // Change number to your form ID
         return $html;
     }
	return '';
}, 10, 3);
      
Copy

👋🏻 Weekly Tutorial Digest

I send out a weekly newsletter with links to new tutorials written in the last week, you can subscribe below.

Newsletter

🔒I won't send you spam, I promise