Ver Mensaje Individual
  #8 (permalink)  
Antiguo 05/09/2008, 05:00
Avatar de Simbelmyne
Simbelmyne
 
Fecha de Ingreso: febrero-2007
Mensajes: 33
Antigüedad: 18 años
Puntos: 0
Respuesta: Activar un checkbox al escribir en input text?

Hola espero que me puedan ayudar tengo un problema similar al de Carl, pero no sé como acomodar el codigo para que pueda habilitarme el checkbox . Te anexo mi codigo para mejor explicacion. Lo que yo quiero hacer es que al momento de que en mi input text 'ComercialName' se haya escrito algo con longitud mayor a 3 caracteres se active el checkbox 'BarCodeExec', de hecho he intentado aplicar tu codigo pero no me sale

Agradezco de antemano cualuier ayuda que me puedan proporcionar

Código HTML:
<table width="796" border="0">
  <tr>
    <td><div align="left" class="Estilo2">Agregar Producto</div></td>
    <td nowrap="nowrap">&nbsp;</td>
  </tr>
  <tr>
    <td nowrap="nowrap"></td>
    <td nowrap="nowrap">&nbsp;</td>
  </tr>
  <form action="" method="post">
  <tr>
    <td nowrap="nowrap" class="Estilo2"><div align="right">Nombre Genérico<span class="Estilo1">*</span>:</div></td>
    <td width="430"><label>
      <input type="text" name="GenericName" id="GenericName" maxlength="50" />
    </label></td>
  </tr>
  <tr>
    <td><div align="right" class="Estilo2">Nombre Producto<span class="Estilo1">*</span>:</div></td>
    <td><label>
      <input type="text" name="ComercialName" id="ComercialName" maxlength="50" onkey="habilita(this)"/>
    </label></td>
  </tr>
  <tr>
    <td class="Estilo2"><div align="right">Descripción:</div></td>
    <td><label>
      <textarea name="Descripcion" id="Descripcion" cols="51" rows="5"><?php echo $Descripcion; ?></textarea>
    </label></td>
  </tr>
  <tr>
    <td class="Estilo2"><div align="right">Categoría<span class="Estilo1">*</span>:</div></td>
    <td><label>
    <input type="text" name="categ" id="categ" />
    </label></td>
  </tr>
  <tr>
    <td><div align="right" nowrap="nowrap" class="Estilo2">Código de Barras<span class="Estilo1">*</span>:</div></td>
    <td><div align="left">
      <input type="text" name="barcode" id="barcode" maxlength="25" />
    </div></td>
  </tr>
  <tr>
    <td></td>
    <td><div align="left" class="Estilo2">
      <input type="checkbox" name="BarCodeExec" id="BarCodeExec" onclick="BarCodeCreation()" disabled="disabled"/>
      Generar Código de Barras automáticamente</div></td>
  </tr>
  <tr>
    <td class="Estilo2">&nbsp;</td>
    <td class= "Estilo1">&nbsp;</td>
  </tr>
  <tr>
    <td class="Estilo2">&nbsp;</td>
    <td><span class="Estilo1">
      <input type="hidden" name="MM_insert" value="frmAdd" />
      </span></td>
  </tr>
  <tr>
    <td class="Estilo2">&nbsp;</td>
    <td><div align="right">
      <input type="submit" name="guardar" id="guardar" value="Guardar Producto" />
    </div></td>
  </tr>
  </form>
</table>