Foros del Web » Programando para Internet » Javascript »

Validar Mayusculas y numericos

Estas en el tema de Validar Mayusculas y numericos en el foro de Javascript en Foros del Web. Hola, Necesito validar que ciertos datos se ingresen con mayúscula y validar tb las entradas numéricas en javascript....
  #1 (permalink)  
Antiguo 12/03/2002, 10:16
 
Fecha de Ingreso: marzo-2002
Mensajes: 29
Antigüedad: 22 años, 2 meses
Puntos: 0
Validar Mayusculas y numericos

Hola, Necesito validar que ciertos datos se ingresen con mayúscula y validar tb las entradas numéricas en javascript.
  #2 (permalink)  
Antiguo 12/03/2002, 10:28
 
Fecha de Ingreso: diciembre-2001
Mensajes: 150
Antigüedad: 22 años, 4 meses
Puntos: 1
Re: Validar Mayusculas y numericos

Hola ebarrios:

Vayamos por partes.

1. Tema de mayúsculas.

<a href='ir.asp?http://www.forosdelweb.com/mensaje.asp?id=67556' target='_blank'>http://www.forosdelweb.com/mensaje.asp?i...</a>

2. Tema de números

JScript Reference:
isNaN Method
Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).

if (!isNaN(numValue)) then
   //es un número
end if

Korrikalari
  #3 (permalink)  
Antiguo 12/03/2002, 10:43
bet
 
Fecha de Ingreso: febrero-2001
Mensajes: 292
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Validar Mayusculas y numericos

Código:
 &lt;html&gt;
&lt;head&gt;
&lt;title&gt; Solo numeros &lt;/title&gt;

&lt;script language=&quot;JavaScript&quot;&gt;
&lt;!--
var nav4 = window.Event ? true : false;

function acceptNum(evt)
{
	// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
	var key = nav4 ? evt.which : evt.keyCode;
	return (key &lt;= 13 || (key &gt;= 48 &amp;&amp; key &lt;= 57));
}


function acceptMay(){
	valor2.value=valor2.value.toUpperCase();
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;input type=text name=&quot;valor&quot; size=12 maxlength=12 onKeyPress=&quot;return acceptNum(event)&quot;&gt;&lt;br&gt;
&lt;input type=text name=&quot;valor2&quot; size=12 maxlength=12 onKeyPress=&quot;acceptMay(this)&quot;&gt;&lt;br&gt;

&lt;/body&gt;
&lt;/html&gt;
<hr noshade size=1><img src="http://www.gograph.com/Images-8712/ClipArt/cat03.gif" height="50" border=0 align="absmiddle"> <font size="2" face="verdana" color="#000000">bet[/CODE]
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:29.