How to do double-click prevention in JSF

前端 未结 7 1094
生来不讨喜
生来不讨喜 2020-11-29 02:56

We have a few search pages that run against a lot of data and take a while to complete. When a user clicks on the search button, we\'d like to not allow them to submit the s

相关标签:
7条回答
  • 2020-11-29 03:40

    Did a simple work with hide and show, works well with element having input type submit Jquery

    $(":submit").click(function (event) {
            // add exception to class skipDisable 
            if (!$(this).hasClass("skipDisable")) {
                $(this).hide();
    			$(this).after("<input type='submit' value='"+$(this).val()+"' disabled='disabled'/>");
            }
        });
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
            <form>
            <input type="submit" value="hello">
            </form>
    0 讨论(0)
提交回复
热议问题