I am using the icheck.min.js
library and the problem is that the onclik
event of my radio buttons no longer work.
The code is in this way:
HTML:
<form method="POST" action="<?php $_SERVER['PHP_SELF']?>" role="form" name="fcontacto">
<div class="form-group">
<label class="col-xs-3 control-label">Denominacion (Negocio)</label>
<div class="col-lg-9">
<label>¿Tienes denominación?</label>
<input type="radio" name="Conocido" id="Conocido_1" onclick="mostrarReferencia();" checked="checked" class="flat-green"> No
<input type="radio" name="Conocido" id="Conocido_0" onclick="mostrarReferencia();" class="flat-green"/> Si
<div id="desdeotro" style="display:none;">
<input type="text" name="denominacion" onkeyup="javascript:this.value=this.value.toUpperCase();" value="N0 ASIGNAD0" class="form-control"/>
</div>
</div>
</div> <!-- termina form-group -->
</form>
Javascript:
<script type="text/javascript"
//este método ya no se llega a ejecutar, no sé por qué
function mostrarReferencia() {
if(document.fcontacto.Conocido[1].checked == true) {
document.getElementById('desdeotro').style.display= 'block';
document.fcontacto.denominacion.value = 'N0- ASIGNAD0';
} else {
document.getElementById('desdeotro').style.display= 'none';
}
}
//Código de icheck que hace que mis radiobotones tomen el color verde
//
$(function() {
$('input[type="radio"].flat-green').iCheck({
radioClass : 'iradio_flat-green'
})
});
</script>
The problem is that I do not know how to implement it so that it works with icheck
and that the onclick
keeps working.