call the same jQuery function in multiple buttons

后端 未结 10 2171
星月不相逢
星月不相逢 2020-12-01 11:12

I am not really familiar with jQuery. I have this code that I downloaded to create a fade in/fade out popup form. Here\'s the code:



        
10条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 11:29

    I have solution for this problem

          $(document).ready(function () {
                        $("#btnSubmit,#btnSubmitbuttom").click(function () {
                            var rfp = true;
                            var count = 0;
                            var lbxBD_Role = $("#lbxBD_Role option:selected").val();
                            if (lbxBD_Role == "" || lbxBD_Role == undefined) {
                                $("#lblBD_Role").attr("style", "visibility: visible");
                                $("#lblBD_Role").attr("style", "color: red");
                                $("#lblBD_Role").html('* Required');
                                count++;
                            }
                          });
                       });
                
    

提交回复
热议问题