javascript - Why does my click event need to be triggered twice? Waiting online, urgent! ! !
某草草
某草草 2017-05-18 10:59:32
0
6
571

As shown in the picture:
If you do not agree to the agreement and click the button in the lower right corner, you will not be able to release the delegation, and a dialog box will pop up. At the same time, set the button to the disabled attribute. (That is: disable the button)
Then I wrote a click event, and if the agreement is checked, the button will be restored.
Then a problem occurred at this time. How should I determine the event? I don't know how to trigger the second event to change the button to the disabled state.

At this time, I tried to write a click event, which can be triggered by clicking on the parent element of this radio button, that is, clicking on that piece. After triggering, the button in the lower right corner will be changed to clickable.

Then I discovered that after the button was disabled, I had to click it twice!

Later I discovered that if I disagree with the agreement in the first step, and then pop up the box, and then disable the lower right button,
I will make the label of the agreement selected and just click this time Once is enough!
However, in this case, the meaning is wrong. The website cannot click the button in the lower right corner without agreeing to the agreement. However, if the button is clicked, the website itself selects the agreement as agreed. Doesn't this force the user to agree to the agreement? ! So, can anyone help me find a solution? urgent! ! !

Below are pictures and codes:
Starting status:

Status after clicking:

The following is the code:

<p class="form-group">
    <p class="checkbox col-xs-offset-2">
        <label class="checkbox-inline">
            <input type="checkbox">
            <span class="text-danger">我已经阅读并同意</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" class="text-primary" target="_blank">《XXXXXXX隐私保护协议》</a>
        </label>
    </p>
</p>
<br>
<p class="row">
    <input type="submit" class="btn btn-info col-xs-offset-3" value="发布专项委托">
</p>


$('.zWt_release_agree').parent().mouseup(function(){
    if($('.zWt_release_agree').attr("checked")){
        $('.zWt_release_spec').attr({"disabled":false})
    }
})
$('.zWt_release_spec').mouseup(function(){
    if(!$('.zWt_release_agree').attr("checked")){
        alert('您必须同意《花瓣儿网隐私保护协议》后,才可以发布委托!')
        $('.zWt_release_spec').attr({"disabled":true})
        $('.zWt_release_agree').attr({"checked":true})
    }
})
某草草
某草草

reply all(6)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!