Vida Una Homepage
Forum Home Forum Home > Programación > Códigos JavaScript
  New Posts New Posts RSS Feed - Numerología: Programa que te generera tu número
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Numerología: Programa que te generera tu número

 Post Reply Post Reply
Author
Message
Programador View Drop Down
Expert@
Expert@
Avatar

Joined: 09 Mayo 2009
Location: San Pedro Alc.
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Programador Quote  Post ReplyReply Direct Link To This Post Topic: Numerología: Programa que te generera tu número
    Posted: 09 Mayo 2009 at 3:10pm

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Día&nbsp;&nbsp;&nbsp; Mes&nbsp;&nbsp;&nbsp;&nbsp; Año</title>
</head>

<body>
 <SCRIPT language=JavaScript>
hacer();
function makeArray() {
  var args = makeArray.arguments;
  for (var i = 0; i < args.length; i++) {
    this = args;
  }
  this.length = args.length;
}

function hacer(){
 numeros=new Array(47);
 num=0;
 for(j=0;j<47;j++){
  if(num>9) num=1;
  numeros[j]=num;
  num++
  }
}
function Validar(){
  if(document.f1.dia.value.length != 2){
  alert("Debes de escribir el día con dos dígitos");
  return false;}
  if(document.f1.mes.value.length!=2){
  alert("Debes de escribir el mes con dos dígitos");
  return false;}
  if(document.f1.anno.value.length!=4){
  alert("Debes de escribir el año con cuatro dígitos");
  return false;}
  if(document.f1.mes.value==4 || document.f1.mes.value==6 || document.f1.mes.value==9 || document.f1.mes.value==11){
  if(document.f1.dia.value>30 || document.f1.dia.value<1){
  alert("¡Este mes sólo tiene 30 días!");
  return false;}
  }
  else if(document.f1.mes.value==2){
  if(document.f1.dia.value>29 || document.f1.dia.value<1){
  alert("¡Febrero sólo puede tener hasta 29 días!");
  return false;}
  }
  else{
  if(document.f1.dia.value>31 || document.f1.dia.value<1){
  alert("¡Los meses sólo pueden tener hasta 31 días!");
  return false;}
  if(document.f1.mes.value>12 || document.f1.mes.value<1){
  alert("¡El año sólo tiene 12 meses!");
  return false;}
  }
Convertir();
return true;
}
function Convertir()
{
  d=document.f1.dia.value;
  m=document.f1.mes.value;
  a=document.f1.anno.value;
  tot=d+m+a;
  tot=parseInt(tot.substring(0,1))+parseInt(tot.substring(1,2))+parseInt(tot.substring(2,3))+parseInt(tot.substring(3,4))+parseInt(tot.substring(4,5))+parseInt(tot.substring(5,6))+parseInt(tot.substring(6,7))+parseInt(tot.substring(7,8));
  tot=numeros[tot];
 
  window.location.href = 'http://servidorweb/n.htm#'+ tot;
}
</SCRIPT>

<FONT face=Verdana size=1>
<table align="center">
                    <TBODY>
<FORM name=f1>                    <tr><td align="center"></td></tr>
    <tr><td>
    </td></tr>
                    <TR>
                      <TD align=middle><font face="Verdana" size="1">&nbsp;Día
                        &nbsp;&nbsp; Mes &nbsp;&nbsp;&nbsp; Año
                        &nbsp;&nbsp;<BR><input type="text"
       name="dia"
       size="2"
       maxlength="2"
       style="font-size: 12PX;">&nbsp; &nbsp; <INPUT maxLength=2 name=mes
                        size=2 style="font-size: 12PX;">&nbsp; &nbsp; <INPUT maxLength=4 name=anno
                        size=4 style="font-size: 12PX;"><BR><BR><INPUT name=Button1 onclick=Validar(); type=button value="Descifrar" style="font-size: 12PX;">
                      </TD></TR></TBODY></FORM>
                      <TR><td align="center">
</td></tr>
</TABLE>
</font>

</body>

</html>

Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.043 seconds.