samedi 25 juin 2016

Jquery this keyword value is getting empty

i am using this keyword in my js file, when i am trying to get the current value using the this keyword,I am getting the value as Empty.not sure where i am going wrong.. Below are the my html and js code..

Html:-

    <div class="uriDiv input-group">
  <select class="common authSelect form-control" name="authType" id="authType">
    <option value="">
      <spring:message code="newPolicy.selectAuthType"></spring:message>
    </option>
    <option value="DB">DB</option>
    <option value="LDAP">LDAP</option>
  </select>
</div>
<td>
  <div class="auth-permission-rd">
    <div class="uriDiv radio radio-left">
      <label>
        <input type="radio" class="common anyuser authPermission" value="anyUser" name="authPermission" disabled="disabled">Any User
      </label>
    </div>
    <div class="uriDiv radio radio-input">
      <label>
        <input type="radio" class="common groupuser authPermission" value="groupUser" name="authPermission" disabled="disabled">
        <input type="text" name="authPermissionValue" disabled="disabled" class="common form-control-placeHolder authPermissionValue" placeholder="Enter custom Permissions - Comma separated" />
      </label>
    </div>
  </div>

js:

 $('input:radio[name=authPermission]').change(function() {
    alert($(this).val());
    if ( $("#authType").val()=='RACF' && $(this).val() =='anyUser'){
           $(this).val('ANY_RACF_USER');
             $('#authPermissionValue').prop('disabled',true);
       }
    else if ( $("#authType").val()=='LDAP' && $(this).val() =='anyUser'){
           $(this).val('ANY_LDAP_USER');
             $('#authPermissionValue').prop('disabled',true);

       }
     if ($(this).val()== 'groupUser'){
         $('#authPermissionValue').prop('disabled',false);
    }
     else{
         $('#authPermissionValue').prop('disabled',true);
         $('#authPermissionValue').val('');
     }

});

Help needed in fixing this...Thanks..

Aucun commentaire:

Enregistrer un commentaire