Disabled (Greyed Out) Form Submit Button



Is it possible to grey out/disable the submit button on a form until all fields have been entered?

All fields on my forms are required and have a Privacy Policy agreement tickbox (yay to being GDPR compliant!). Once all fields have been completed, the submit button would change colour (washed out grey to blue) and become usable.

Any ideas anyone?




Hmm, this could probably be done with custom Javascript. But just curious, have you considered just marking your form fields as “required?” That way, the form cannot be submitted until they are filled out. Otherwise it will throw an error.


Hi @Nicholas

Thanks for your feedback :slight_smile:

All our fields are required, so it does throw an error if a user clicks submit. From a design perspective, we think having it greyed out/disabled would prompt people to complete the fields to enable the submit button.

Any ideas on the custom JavaScript?



I don’t have any JavaScript, but I find this to be an interesting idea. I’m curious how well it works!


Hey @Jack_Walsh and @Jennifer_wp,

Here’s some code you can test. Warning: I’m not a developer. We just have an awesomely amazing developer that works with us. This is what we use to make this work:

Demo page: http://unbouncepages.com/disable-form-button/

Add this CSS to the stylesheets tab:

  #lp-pom-form-9 a.disabledButton{
    pointer-events: none;
    cursor: not-allowed;
    background: rgb(168, 229, 247);
    color: #b7b4b4;

And add this to the JavaScripts tab:

  var formEl = "#lp-pom-form-9 form";
  var buttonToDisable = "#lp-pom-button-10";
$(document).ready(function() {
  $(formEl + ' input').keyup(function(){
  $(formEl + ' input').change(function(){
  $(formEl + " select").change(function(){

function validate() {
  var inputsWithValues = 0;
  // get all input fields except for type='submit'
  var inputs = $(formEl + " input");

  inputs.each(function(e) {
    // if it has a value, increment the counter
    if ($(this).val()) {
      inputsWithValues += 1;
  if (inputsWithValues == inputs.length && validateCheckbox() && validateSelects()) {
  } else {
  function validateCheckbox(){
    var checkboxChecked = false;
  	$(formEl + " [type='checkbox']").each(function(){
        	checkboxChecked = true;
          	return true;
    return checkboxChecked;
  function validateSelects(){
  	var selects = $(formEl + " select");
    var selectsWithValues = 0;
    selects.each(function(e) {
      // if it has a value, increment the counter
      if ($(this).val()) {
        selectsWithValues += 1;
    if(selectsWithValues == selects.length){
    	return true;
    	return false;

You need to change the “#lp-pom-form-9 form” and “#lp-pom-button-10” to match your form and form button IDs of course.


This is amazing! Thank you SO much @Nicholas!

:heart_eyes: Can’t wait to try this!


Very cool Nicholas! Thanks for sharing :slight_smile: