Can't get past validation if miss it at first try

Seems like there's a bug.

If a user forgets to select the checkbox to agree with the TOS, and hits SUBMIT to proceeds then the page gets stuck and they can't get past the validation.

Please see video of bug.
https://youtu.be/QcLD_wakLr0

  • Majid

    Hey Robert,

    I was able to replicate the issue and it's indeed a bug, I will make sure the developer get notified about this, and I will let you know in a reply when I get their feedback.

    For now the following snippet is quick fix, add this to your theme's functions.php or to an mu plugin.

    function tos_quick_fix() {
    ?>
    	<script type="text/javascript">
    		(function($) {
    			$(document).ready(function() {
    				var $input = $(document).find('input[name="tos_agree"]');
    				$input.val(0);
    				$(document).on('change', 'input[name="tos_agree"]', function() {
    					var v = $(this).val(),
    					$inputs = $(document).find('input[name="tos_agree"]');
    					$inputs.val(Math.abs(v - 1));
    				});
    			});
    		})(jQuery);
    	</script>
    <?php
    }
    add_action( 'wp_footer', 'tos_quick_fix' );

    Cheers,
    Majid