sábado, 27 de octubre de 2012

Validacion del ruc video

http://www.youtube.com/watch?feature=player_detailpage&v=JoHnJ6cV2a0

Validar cedula


<html>
<head>
<script type="text/javascript">
function validarcedula()
{
var i;
var cedula;
var acumulado;
cedula=document.formacedula.textocedula.value;
var instancia;
acumulado=0;
for (i=1;i<=9;i++)
{
if (i%2!=0)
{
instancia=cedula.substring(i-1,i)*2;
if (instancia>9) instancia-=9;
}
else instancia=cedula.substring(i-1,i);
acumulado+=parseInt(instancia);
}
while (acumulado>0)
acumulado-=10;
if (cedula.substring(9,10)!=(acumulado*-1))
{
alert("Cedula no valida!!");
document.formacedula.textocedula.setfocus();
}
alert("Cedula valida !!");
}
</script>
</head>
<body>
<form name="formacedula">
<input type="text" id="textocedula" onchange="validarcedula()">
</form>
</body>
</html>

Valor mas bajo


<html>
<head>
<b>DaTos</b>
</head>
 <body>
  <form>
<p> bajo<input type="text" name="baj"   onChange = "validar()" > </p>
 <p> medio <input type="text" name="med"  onChange = "validar()" >   </p>
  <p> alto<input type="text" name="alt"  onChange = "validar()"  > </p>
 <p> <input type ="button" value="Probar" onClick="validar(baj.value, med.value, alt.value)" > </p>
</form>
 </body>


 <script type="text/javascript">
 function validar(v){

y= v.length
for(i=0; i<y; i++){
z= v.substring(i,i+1);
if((z!="0") && (z!="1" )&&( z!="2") && (z!="3") && (z!="4") && (z!="5") && (z!="6") && (z!="7") && (z!="8") && (z!="9") )
{}
else{

alert("solo valores numericos")}
}
 }

 function resultado(x,y,z){
 if ((x<y) && (x<z)){
 if(y<z){
 alert("correcto")
 else{
 alert("error el numero medio es mayor")
 }
 }


 }
 else{
 alert("Error ")
 }

 }

 </script>


 </html>

Numero binario Practica


<html>
<head>
<b>Clase25-09-2012</b>
</head>
 <body>
  <form>
  <input type="text" name="nota1"   onChange = "validar(this.value)" >
  <input type ="button" value="Validar" onClick="resultado()" >
</form>
 </body>


 <script type="text/javascript">
 function validar(x){
 a=0
y= x.length
for(i=0; i<y; i++){
z= x.substring(i,i+1);
if((z=="0") || (z=="1" ) ){
a=a+1
}

}
if (a == y){

alert("si es binario")}
else{
alert("No es binario")
}

 }

 </script>
 </html>

Cuestionario #2


<html>
<head>

<tittle><center><h1>CUESTIONARIO</center></tittle>
<h2>Cristobal colon descubrio America.?</h2> </p>

  <input type="radio" value="1" name="musica" id="idex1">Verdadero<BR>
  <input type="radio"name="musica"value="2" id="idex2">Falso<BR>              
  <input type="radio"name="musica"value="3" id="idex3">Ninguna de las anteriores </p>


<h2>De que color es el caballo blanco de Simon Bolivar.?</h2> </p>

  <input type="radio" value="4" name="simon" id="idex4" >Blanco<BR>
  <input type="radio"name="simon"value="5" id="idex5" >Amarillo <BR>              
  <input type="radio"name="simon"value="6" id="idex6" >Rosado </p>
 
<h2>Cuales son los colores de la bandera del Ecuador.?</h2> </p>

<input type="checkbox"name="check[]" id="check7" value="7" >Amarillo</p>
  <input type="checkbox"name="check[]" id="check8" value="8">Azul</p>
  <input type="checkbox"name="check[]" id="check9" value="9">Rojo</p>
 
  <h2>Cuales son Animales Domesticos...?</h2> </p>

<input type="checkbox"name="check[]" id="check10" value="10">Gallina</p>
  <input type="checkbox"name="check[]" id="check11" value="11">Tigre</p>
  <input type="checkbox"name="check[]" id="check12" value="12">Perro</p>




  <input type ="button" value="enviar" onClick="resultado()" >




  <script type="text/javascript">
function resultado(){

 pre1=5;
 cero=0;

 if (document.getElementById('idex1').checked &&
  !document.getElementById('idex2').checked&&
  !document.getElementById('idex3').checked)
  {
  primera=pre1;
  }

   else
    primera=cero;
    if (document.getElementById('idex4').checked &&
        !document.getElementById('idex5').checked&&
        !document.getElementById('idex6').checked)
      {
 
         segunda=pre1;
      }  else
        segunda=cero;

    if (document.getElementById('check7').checked &&
        document.getElementById('check8').checked&&
        document.getElementById('check9').checked)
      {
 
        tercera=pre1;
      } else
        tercera=cero;


    if (document.getElementById('check10').checked &&
        !document.getElementById('check11').checked&&
        document.getElementById('check12').checked)
      {
 
        cuarta=pre1;
      } else
        cuarta=cero;
        suma=primera+segunda+tercera+cuarta;

    {

    alert ("Su puntaje es "+suma);
    }
}
</script>
</html>

Datos practica


<html>
<head>
<b>DaTos</b>
</head>
 <body>
  <form>
<p> Nombre <input type="text" name="nota1"   onChange = "validar(this.value)" >
 <p> Telefomo <input type="text" id="nota2"  onChange = "validar(this.value)" >  
  <p> Direccion <input type="text" id="nota3"  onChange = "validar(this.value)"  >

</form>
 </body>



 </html>

Etiquetas


<script type= "text/javascript>

function hola mundo()
<p>Usuario
<input type="text" onkeypress="hola mundo" id="nombre" name="nombre">
<input type="text" onchange="hola mundo"  id="nombre" name="nombre">

</script>

Practica , envio de datos


<html>
<head>
Practica
</head>
  <body>
   <form>
Ingrese el usuario<p>
nombre<input type= "text" id="nombre" maxlenght=10><p>

direccion<input type= "text" id="direccion"><p>
contraseña<input type= "password" id="clave"><p>
opcion<b><input type= "option" value=""><p>
chek<input type= "checkbox" id=jiji"><p>

<input type= "range" name="cachuda" min=1 max=10><p>

envio<input type= "submit" id="enviar"><p>
  </form>
 </body>
</html>

El "Option"


<html>
<head>
Practica
</head>
  <body>
   <form>
<b> Seleccione<b>
<select id="xxx" name="yyy">
<option> Emelec
<option> barcelona
<option> liga
</select>




  </form>
 </body>
</html>

Formulario de datos personales


<html>
<head>
<h1><b><center>FORMULARIO</center></b></h1>
<body>
<form>
CONTRASEÑA: <input type="password" id="contraseña"></br><br>
<p><img src="http://sphotos-g.ak.fbcdn.net/hphotos-ak-snc7/397025_331878813523896_1759165512_n.jpg">
<fieldset>
CEDULA: <input type="text" id="cedula" maxlength= 11></br><br>
NOMBRE: <input type="text" id="nombre" maxlength= 40></br><br>
DIRECCION: <input type="text" id="direccion" maxlength= 60></br><br>
TELEFONO: <input type="text" id="telefono" maxlength= 20></br><br>
CURSO: <select id="seleccionar">
<option></option>
<option> 4 NIVEL"A" </option>
<option> 4 NIVEL"B" </option>
</select></br></br>
</fieldset>
<hr>
<fieldset>
<p><b>SEXO</b></p>
MASCULINO <input type="checkbox"></br>
FEMENINO <input type="checkbox"></br>
</fieldset></br>
<fieldset>
<p><b>TIPO DE MUSICA</b></p>
ROCK <input type="checkbox"></br>
POP <input type="checkbox"></br>
BALADA <input type="checkbox"></br>
</fieldset></br>
<input type="submit" value="NUEVO">
<input type="submit" value="ENVIAR">
</form>
</body>
</html>

Cuestionario


<html>
<head>
<CENTER>
<b>CUESTIONARIO
</CENTER>
</head>
 <body>
  <form>

 <p> Nombre:<input type="text" id="nombre">
 <p>Fecha:<input type="text" id="fecha">
 <p>Curso:<input type="text" id="Curso">

<p><b>1)Que color es el caballo blanco de Simon Bolivar? </b>

<p><Select id="color">
   <p><option value=1> Negro
   <option value=2> Amarillo
   <option value=3> Blanco
   </select>

<p><b>2)Cual es el mejor mejor amigo del hombre?</b>
    <p> <select id="mejor">
     <option value=1> gato
     <option value=1> cerveza
     <option value=1> perro
   </select>

<p><b>3)Que provincias pertenecen al Ecuador?</b>

   <p><input type= "checkbox" value=1> Manabi
  <p> <input type= "checkbox" value=2> Pichincha
  <p> <input type= "checkbox" value=3> Argentina
  <p> <input type= "checkbox" value=4> Todas las Anteriores

<p><b>4)Selecciones los perifericos de Entrada de una PC</b>


  <p> <input type= "checkbox" value=1> scanner
  <p> <input type= "checkbox" value=2> teclado
  <p> <input type= "checkbox" value=3> monitor
  <p> <input type= "checkbox" value=4> impresora
  <p> <input type= "checkbox" value=5> todas las anteriores

</form>
 </body>
</html>

El "onkeypress" Mostrar letra a lera de una palabra


<html>
<head>
Practica
</head>
  <body>

<p>Ingrese palabra a deletrear
<p><input type="text" onkeypress="clases_web()" id="nombre">



 </body>
</html>

<script type= "text/javascript">

function clases_web()
{
alert(document.getElementById("nombre").value);
}

</script>

Solo valores numericos..#2


<html>
<head>
<b>Clase25-09-2012</b>
</head>
 <body>
  <form>
  <input type="text" name="correo"   onChange = "validar(this.value)" >
  <input type="text" id="fecha"  onChange = "fecha(this.value)" >
  <input type="text" id="telefono"  onChange = "validar(this.value)"  >

</form>
 </body>


 <script type="text/javascript">
 function validar(x){
y= x.length
for(i=0; i<y; i++){
z= x.substring(i,i+1);
if(z=="@" )
{alert(x)}
else{
alert("no ingreso "@"")}
}
 }

 function fecha(f)

 </script>
 </html>

Solo valores numericos.. # 1


<html>
<head>
<b>Clase25-09-2012</b>
</head>
 <body>
  <form>
  <input type="text" name="nota1"   onChange = "validar(this.value)" >
  <input type="text" id="nota2"  onChange = "validar(this.value)" >
  <input type="text" id="nota3"  onChange = "validar(this.value)"  >
  <input type ="button" value="Validar" onClick="resultado()" >
</form>
 </body>


 <script type="text/javascript">
 function validar(x){

y= x.length
for(i=0; i<y; i++){
z= x.substring(i,i+1);
if((z!="0") && (z!="1" )&&( z!="2") && (z!="3") && (z!="4") && (z!="5") && (z!="6") && (z!="7") && (z!="8") && (z!="9") )
{}
else{

alert("solo valores numericos")}
}
 }

 </script>
 </html>