Tengo una pagina en php en la cual tengo una tabla la cual muestra productos de un negocio, al final de cada tabla le he agregado un checkbox y un textbox, esto es para que el usuario tilde los productos que quiera vender e ingrese en el textbox la cantidad del mismo producto que desea vender.
este es el codigo:
Código PHP:
<?php
include_once 'lib.php';
$conexion= mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($database, $conexion);
$result = mysql_query("SELECT id_stock, codigo, descrip, pre_min, pre_may, disponibles FROM stock where activo = '1'", $conexion);
echo"<form name='borrar' method='post' action='vender_prod.php'>";
echo"<table border='2'>
<tr>
<th>ID</th>
<th>Codigo</th>
<th>Descrip</th>
<th>Prec.Min</th>
<th>Prec.May</th>
<th>Disponibles</th>
<th></th>
<th style='border: none'></th>
<th>Cantidad</th>
</tr>";
$i=0;
while($row = mysql_fetch_array($result)){
echo "<tr>
<td>$row[id_stock]</td>
<td>$row[codigo]</td>
<td>$row[descrip]</td>
<td align=right>$$row[pre_min]</td>
<td align=right>$$row[pre_may]</td>
<td align=center>$row[disponibles]</td>
<td><input name='seleccion[]' type='checkbox' value=$row[id_stock]></td>
<td style='border: none'></td>
<td><input name='text[$row[id_stock]]' type='text' style='width: 60'></td>
</tr>";
$i++;
}
echo "</table>";
echo "<br>";
echo "<input type='submit' name='submit' value='enviar'>";
echo "</form>";
echo "</form>";
?>
Lo que quiero hacer es que los textbox se habiliten unicamente si e checkbox esta tildado. Como hago esto. gracias