Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/08/2009, 12:34
Avatar de lair
lair
 
Fecha de Ingreso: enero-2009
Ubicación: header('Location: Morelia");
Mensajes: 1.052
Antigüedad: 16 años, 2 meses
Puntos: 46
Respuesta: comparar valores con mensaje

si entendi bien tu problema creo que quieres algo como esto:

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
input{
	color: #006699;
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-stretch: normal;
	font-style: normal;
	font-variant: normal;
	font-weight: bold;
	letter-spacing: normal;
	line-height: normal;
	text-decoration: none;
	text-transform: none;
}
-->
</style>


<!-- esto es lo que compara y envia la alerta -->
<script>
	function verifica(){
		if(document.getElementById('aprobado').value>document.getElementById('pedido').value){
			alert('no puede ser mayor');
		}
	}
</script>



</head>

<body>
<form id="form1" name="form1" method="post" action="">
 <table width="100%" border="1" cellspacing="0" cellpadding="2">
  <tr>
    <td width=10% align=center>Codigo</td>
    <td width=40% align=center>Descripcion</td>
    <td width=10% align=center>Pedido</td>
    <td width=10% align=center>Aprobado</td>
    <td width=30% align=center>Observacion</td>
  </tr>
 <!-- Cada <tr> se itera de acuedo a dostos que obtengo externamente, podria ser 1 tr o 100 tr y cada una con la variable de mismo nombre -->
  <tr>
    <td width=10% align=center>0001</td>
    <td width=40% align=lef>AAAAAAAAAAAAAAAAAAAAAA</td>

<!-- Pon atencion a los id que agregue -->
    <td width=10% align=center><input type="text" name="dice" readonly="readonly" value="4" size=6 maxlength=4 id='pedido' /></td>
    <td width=10% align=center><input type="text" name="debe" size=6 maxlength=4 id='aprobado' onblur='verifica()'/></td>


    <td width=30% align=left><input name="observa" type="text" size="30" maxlength="30" /></td>
  </tr>
  <tr>
    <td width=10% align=center>0002</td>  
    <td width=40% align=left>BBBBBBBBBBBBBBBBBBBBBBBB</td>
    <td width=10% align=center><input name="dice" readonly="readonly" type=text value="10" size=6 maxlength=4/></td>
    <td width=10% align=center><input type="text" name="debe" size=6 maxlength=4/></td>
    <td width=30% align=left><input name="observa" type="text" size="30" maxlength="30" /></td>
  </tr>
  <tr>
    <td width=10% align=center>0003</td>
    <td width=40% align=left>CCCCCCCCCCCCCCCCCCCCCC</td>
    <td width=10% align=center><input name="dice" readonly="readonly" type=text value="8" size=6 maxlength=4/></td>
    <td width=10% align=center><input type="text" name="debe" size=6 maxlength=4 /></td>
    <td width=30% align=left><input name="observa" type="text" size="30" maxlength="30" /></td>
  </tr>
</table>
</form>
</body>
</html> 
suerte y cualquier cosa por aqui estamos