You are viewing limited content. For full access, please sign in.

Question

Question

How to Hide Submit Button based on Table column value

asked on May 31, 2019

Column A is typed in. 

Column B displays options based on lookup from data in column A. 

Column C will display value based on lookup from column B (if a value is returned).

 

I am trying to get the Submit button to be hidden if there is ANY value in any row in Column C.

  $(document).ready(function()
  
{
  
  $('.Table').on('change','.C input', outsideservice);
    console.log("0.5");
  
  function outsideservice()
  {
    
    $('.Table tbody tr').each(function () 
      {
        $(this).find('.C input').each(function () 
        {
        if ($(this).val() != '')
          {
          
          $('.Submit').hide();
        }
          else
             {
         $('.Submit').show();
          
          
          
             }
        
          });
      
        });
    
      }
     
    });

0 0

Answer

SELECTED ANSWER
replied on May 31, 2019 Show version history

Instead of using JavaScript, just create your own submit button with a Custom HTML element, hide the built-in one with CSS, and then use field rules to show/hide your custom button.

This will hide the default button

.Submit {
    display:none !important;
}

and this is all the HTML you need for a fully functional Submit button

<button type="Submit" value="Submit">Submit</button>

 

1 0
replied on May 3, 2021

This should be an option without creating our own submit button with html, but I love this solution!!!  Thank you.  This will be helpful in so many ways on my forms!

0 0
replied on May 3, 2021

I agree. I like the idea of Field Rules working for the submit button, but the solution works pretty well. They did however make things a lot better in the later versions because lookups now disable the submit button until they're complete.

1 0

Replies

replied on June 3, 2019

Wow.  Sometimes I over complicate things by ignoring the basics.  Thank you very much for that easy and clear suggestion.  It worked as intended.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.