Jump to content

Ayuda Con textfield y Spry


Recommended Posts

Hola Cumpas:

 

Quiero hacer lo siguiente con varios textfield y las validaciones con Spry de Dreamweaver.

lo que necesito es tener 'N' cantidad de textfield y que esten validados para que las cantidades (enteras) ingresadas en todos

sumen 100 (eje: 10+30+60). Lo eh intentado colocando varios textfield dentro de un sprytextfield1 (validacion) pero no resulta.

 

no tengo código para mejorar porque no se si este bien asi como voy.

Si alguien me puede ayuda, le agradezco.

 

saludos.

 

MIRA ACA ESTA, ES ALGO GENERAL, PERO NECESITO QUE UNA VALIDACION ENTRE 0 Y 100 ABARQUE TODOS LOS TEXTFIELD

<!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ítulo</title>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <span id="sprytextfield1">
  <input type="text" name="text1" id="text1" />
  <span class="textfieldRequiredMsg">Se necesita un valor.</span><span class="textfieldInvalidFormatMsg">Formato no válido.</span><span class="textfieldMaxValueMsg">El valor introducido es superior al máximo permitido.</span></span>
  <p><span id="sprytextfield2">
  <input type="text" name="text2" id="text2" />
  <span class="textfieldRequiredMsg">Se necesita un valor.</span><span class="textfieldInvalidFormatMsg">Formato no válido.</span><span class="textfieldMaxValueMsg">El valor introducido es superior al máximo permitido.</span></span></p>
  <p><span id="sprytextfield3">
  <input type="text" name="text3" id="text3" />
  <span class="textfieldRequiredMsg">Se necesita un valor.</span><span class="textfieldInvalidFormatMsg">Formato no válido.</span><span class="textfieldMaxValueMsg">El valor introducido es superior al máximo permitido.</span></span></p>
  <p>
    <input type="submit" name="button" id="button" value="Enviar" />
  </p>
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {minValue:0, maxValue:100});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "integer", {minValue:0, maxValue:100});
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "integer", {minValue:0, maxValue:100});
//-->
</script>
</body>
</html>

Edited by Felipin_182
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...