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

Question

Question

Hide Submit Button (OTP)

asked on November 14, 2019

Hi All,

I'm looking to hide the submit button if two fields don't match, and unhide when they do.

the use case is that i am inserting the instance ID into a field and using workflow to email the ID to user as a OTP. The user then needs to enter the OTP into a field and if it does not match then hide the submit.

I've reviewed all the topics with "Hide Submit Button" but nothing that i can use.

Appreciate any and all help 

0 0

Answer

SELECTED ANSWER
replied on November 15, 2019

In the Forms Business Process Library, there is a 

  • CSS, JavaScript, and Formula Examples

Inside here there is validation on an email field using Javascript, that if the two fields do not match then remove the Submit Button, you may be able to adapt this code to help you.

 

$(document).ready(function () {

  $('.Submit').hide(); 

  

  $('.email, .confirm').on('blur input', function () {



        if ($('.email input').val() != $('.confirm input').val()) {

           $('.Submit').hide();

            if ($('.warningText').length > 0 || $('.confirm input').val() == '') { return; }

            else {

                $('<p class="warningText">The email addresses you entered do not match.</p>').insertAfter('.confirm');

            }

        }

        else

            $('.warningText').remove();

        $('.Submit').show();



    });

});

 

4 0

Replies

replied on November 16, 2019

Thanks Anthony, 

ill give this a swing. appreciate it. 

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

Sign in to reply to this post.