mercredi 5 juillet 2017

I need to set next button as disabled till any radio button got selected

In my use case i need to set Next button from a popup is disabled in default till any one of the radio button got selected.

Need to achieve this in Ember.Js

My hbs code (for that popup):


<div id="listAllAccounts" class="modal animated fadeInUp modal-pop downloadAsPopup">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>
        <h4 class="modal-title">List of accounts</h4>
      </div>
      <div class="modal-body">
        <div class="textGroup">
          <h2 class="primaryTitle">Select an account.</h2>
        </div>
        <div class="modalTableHolder">
          <table class="primaryListTable" id="AccountsInfo">
            <thead>
              <td class="tablestyle5">Account ID</td>
              <td class="tablestyle5">Account Name</td>
            </thead>
            <tbody>
              
                <tr>
                  <td class="tablestyle5"><input type="radio" name="accounts" class="messageCheckbox mt6 mR5" data-acc-name= value=></td>
                  <td class="tablestyle5"></td>
                </tr>
              
            </tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <div class="text-right">
          <button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true" >Cancel</button>
          <button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true" >Next</button>
        </div>
      </div>
    </div>
  </div>
</div>


JS code:

Ember.run.scheduleOnce('afterRender', this, function() {
          new URI(Abc, this.get('currentOrg.ABC_ID'), Project, this.get('defaultProject.PROJECT_ID'), Integration)
          .addQueryParam('email', this.get(email))
          .GETS()
          .then(function(res) {
            if(res.length !== 0){
              var sett = projectObj.get("INTEGRATION");
              self.set("model.integration", res);    //this is where i set data to that popup
              common.hideModal("loadingPopup");
              common.showModal("listAllAccounts");  
            } else {
              common.hideModal("loadingPopup");
              options.content = i18n("enable.integration.noaccount.error");
              options.type = 'warning';
              dialog.showCard(options);
            }
          });

This is the popup. I need to disable the next button until anyone selects any one radio button. If radio button is checked i need to enable next option.

enter image description here




Aucun commentaire:

Enregistrer un commentaire