dimanche 24 mars 2019

iCheck Enable/Disable Input-File(Boostrap) Button when i check a checkbox

Hello im using iCheck(http://icheck.fronteed.com/) The problem is, when i click the checkbox, input-file button works but appears to be "disabled".

I'm using two events, ifChecked/ifUnchecked.

I tried before, using instead of .prop(), attr, removeclass, addclass

"input id="Archivo" name="Archivo" type="file" accept=".pdf,.doc" disabled"

 $("#Archivo").fileinput({
    language: "es",
    browseClass: "btn btn-primary",
    showCaption: true,
    showRemove: false,
    showUpload: false,
    browseLabel: " Buscar",
    allowedFileExtensions: ["pdf", "doc"],
    elErrorContainer: "#divErrorImagen",
    maxFileSize: 122880
}); 


$('input').on('ifChecked', function (event) {
    console.log("Checked OK")
   $('#Archivo').prop("disabled", false);


});
$('input').on('ifUnchecked', function (event) {
    console.log("Unchecked OK")
   $('#Archivo').prop("disabled", true);

});




Aucun commentaire:

Enregistrer un commentaire