Hola que tal... tengo este formulario llamado "meses" donde cada campo tiene su checkbox donde al ponerlo en checked se me habilita o deshabilita cada campo...
cada campo tiene un value por defecto...
Código HTML:
Ver original <td><input type="checkbox" id="check1" onclick="if(this.checked==true)this.form.enero.disabled=true;else this.form.enero.disabled=false"><label for="check1" >Enero
</label></td> <td><input name="enero" type="text" value="18"></td> <td><input type="checkbox" id="check2" onclick="if(this.checked==true)this.form.febrero.disabled=true;else this.form.febrero.disabled=false"> <label for="check2" >Febrero
</label><br /></td> <td><input name="febrero" type="text" value="12"></td> <td><input type="checkbox" id="check3" onclick="if(this.checked==true)this.form.marzo.disabled=true;else this.form.marzo.disabled=false"> <label for="check1" >Marzo
</label></td> <td><input name="marzo" type="text" value="62"></td> <td><input type="checkbox" id="check4" onclick="if(this.checked==true)this.form.abril.disabled=true;else this.form.abril.disabled=false"> <label for="check2" >Abril
</label><br /></td> <td><input name="abril" type="text" value="89"></td> <td><input type="checkbox" id="check5" onclick="if(this.checked==true)this.form.mayo.disabled=true;else this.form.mayo.disabled=false"> <label for="check1" >Mayo
</label></td> <td><input name="mayo" type="text" value="45"></td> <td><input type="checkbox" id="check6" onclick="if(this.checked==true)this.form.junio.disabled=true;else this.form.junio.disabled=false"> <label for="check2" >Junio
</label><br /></td> <td><input name="junio" type="text" value="18"></td> <td><input type="checkbox" id="check7" onclick="if(this.checked==true)this.form.julio.disabled=true;else this.form.julio.disabled=false"> <label for="check1" >Julio
</label></td> <td><input name="julio" type="text" value="16"></td> <td><input type="checkbox" id="check8" onclick="if(this.checked==true)this.form.agosto.disabled=true;else this.form.agosto.disabled=false"> <label for="check2" >Agosto
</label><br /></td> <td><input name="agosto" type="text" value="78"></td> <td><input type="checkbox" id="check9" onclick="if(this.checked==true)this.form.septiembre.disabled=true;else this.form.septiembre.disabled=false"> <label for="check1" >Septiembre
</label></td> <td><input name="septiembre" type="text" value="159"></td> <td><input type="checkbox" id="check10" onclick="if(this.checked==true)this.form.octubre.disabled=true;else this.form.octubre.disabled=false"> <label for="check2" >Octubre
</label><br /></td> <td><input name="octubre" type="text" value="22"></td> <td><input type="checkbox" id="check11" onclick="if(this.checked==true)this.form.noviembre.disabled=true;else this.form.noviembre.disabled=false"> <label for="check1" >Noviembre
</label></td> <td><input name="noviembre" type="text" value="50"></td> <td><input type="checkbox" id="check12" onclick="if(this.checked==true)this.form.diciembre.disabled=true;else this.form.diciembre.disabled=false"> <label for="check2" >Diciembre
</label><br /></td> <td><input name="diciembre" type="text" value="20"></td>
Lo que quiero lograr es que ademas de deshabilitar el campo a la hora de activar el checkbox tambien se deshabilite el checkbox y el valor del campo cambie a 0 (cero)...
puedo lograrlo con javascript?