Ver Mensaje Individual
  #28 (permalink)  
Antiguo 10/11/2008, 10:53
Avatar de hoberwilly
hoberwilly
 
Fecha de Ingreso: julio-2008
Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 15 años, 10 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