如果禁用复选框,则如何禁用该按钮

时间:2016-07-23 06:37:28

标签: checkbox ionic-framework

以下是我的代码

    <li class="item item-checkbox  checkbox-assertive">I have read and agree to abide by the<br/> <a ng-click="showPopup()">terms and conditions</a>
        <label class="checkbox">
            <input type="checkbox"  name="accept" required>
        </label>
    </li>

    <a ng-href="#/search/{{select.mySelect}}/{{select.mySelect1}}" id="bloodBankIndia-button1" class=" button button-assertive  button-block icon-left ion-ios-search " ng-disabled="form.$invalid || form1.$invalid">Search</a>
</div>

1 个答案:

答案 0 :(得分:0)

对于TOS,您可以使用以下内容:

<form action="#" onsubmit="if(document.getElementById('agree').checked) { return true; } else { alert('Please indicate that you have read and agree to the Terms and Conditions'); return false; }">

<input type="checkbox" name="checkbox" value="check" id="agree" /> I have read and agree to the Terms and Conditions
<input type="submit" name="submit" value="submit" />

</form>

P.S。 Disabled is not a valid attribute for the anchor tag.

如果你想在评论中使用ui-sref,如上面提到的Harish Kommuri,你可以something like this