![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/11/2008, 10:53
|
![Avatar de hoberwilly](http://static.forosdelweb.com/customavatars/avatar246730_1.gif) | | | Fecha de Ingreso: julio-2008 Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 16 años, 7 meses Puntos: 2 | |
Respuesta: Envio de mensaje js al no haber stock disponible Esto es lo qute tengo:
function check_stock(id,cantidad)
{
var stockdisponible=document.getElementById('stockdisp onible[' +id+ ']').value;
if(cantidad>stockdisponible)
{
alert('La demanda es mayor que el stock');
return false;
}
else
{
return true;
}
}
<form onsubmit="(this.??????????????)")
<td align="center"><input type="text" name="cantidad_autorizada" id="cantidad" value=" " size="4" maxlength='6' onKeypress="return acceptNumNumero(this)"></td>
<td align="right">
<?php
$qry2 = mysql_query("select stock from catalogo where id='".$v['id']."'");
if ($row2 = mysql_fetch_assoc($qry2))
{
echo $row2['stock'];
}
?>
</td>
<td><input type="hidden" id="stockdisponible[".$v['id']."]" value="".$row2['stock']."" /></td>
<td><input type="submit" value="Autorizar"></td>
</table>
</form>
como colocar el formulario con el submit???? por favor |