2016-07-23 28 views
0

下面的檢查是我的代碼如何禁用按鈕,除非複選框沒有離子

<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> 
+0

錨標籤不能禁用和按鈕可以。在離子框架中,您可以使用'ui-sref'屬性來瀏覽頁面。爲按鈕設置'ui-sref'並禁用它們。 – Harish

回答

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> 

附: Disabled is not a valid attribute for the anchor tag.


如果你想使用的用戶界面,SREF,如上面的評論中提到Harish Kommuri,可以使something like this

相關問題