Foros del Web » Programando para Internet » Javascript »

Ayuda Pliz

Estas en el tema de Ayuda Pliz en el foro de Javascript en Foros del Web. Hola , quisiera ver si alguien me pudiera ayudar con un script el problema es el siguiente, tengo 2 campos input, cuando capturo el primer ...
  #1 (permalink)  
Antiguo 25/04/2008, 12:24
 
Fecha de Ingreso: abril-2003
Ubicación: Monterrey, Nuevo Leon Mex
Mensajes: 300
Antigüedad: 21 años
Puntos: 3
Ayuda Pliz

Hola , quisiera ver si alguien me pudiera ayudar con un script el problema es el siguiente, tengo 2 campos input, cuando capturo el primer campo y le doy enter se va al siguiente campo input, y cuando le doy algun dato se me posiciona en el campo anterior lo que quisiera es como hacerle para que se posicionara automaticamente en un boton que se llama aceptar, a ver si alguien me pudiera ayudar con este problema.

Pongo codigo
Código:
<script>
function tabular(e,obj) {
  tecla=(document.all) ? e.keyCode : e.which;
  if(tecla!=13) return;
  frm=obj.form;
  for(i=0;i<frm.elements.length;i++) 
    if(frm.elements[i]==obj) { 
      if (i==frm.elements.length-1) i=-1;
      break }
  frm.elements[i+1].focus();
  return false;
}
</script> 
<style type="text/css">
<!--
.Estilo99 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #FF0000;
}
body {
	background-image: url(../images/fondoconta.jpg);
}
.Estilo1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #003399;"
     }
    -->
     </style>

<?php
$fpol=date('d-m-Y');
include("../includes/conectar.php");

   echo "<div align=\"center\">"
   . "<link rel=\"StyleSheet\" href=\"../style.css\" type=\"text/css\">" 
   . "  <center><br>";
   echo "<br><fieldset style=\"height:70px; width:250px; text-align:left; padding-left: 20px;\" title=\"Carga de Polizas\">"
."<legend align=\"center\"><b>Carga de Polizas</b></legend>"
."<table width=\"210\" border=\"0\" align=\"center\">"
  ." <form method=\"post\" 
  
action=\"checapoliza.php?gpo=$gpo&cia=$cia&cta=$cta&sct=$sct&ssc=$ssc&nom=$nom&nat=$nat&rubbal=$rubbal&rubfis=$rubfis\" >"
."  <tr>"
."    <th width=\"149\" scope=\"col\"><div align=\"left\"><span class=\"Estilo1\">Num. de Poliza </span></div></th>"
."    <th width=\"71\" scope=\"col\"><span class=\"Estilo1\"><div align=\"left\">"
."      <input value=\"$npol\" onkeypress=\"return tabular(event,this)\" name=\"npol\" type=\"text\" size=\"4\" />"
."    </div></th>"
."  </tr>"
."  <tr>"
."    <td><div align=\"left\"><span class=\"Estilo1\">Fecha de Poliza </span></div></td>"
."    <td><input value=\"$fpol\" onkeypress=\"return tabular(event,this)\" name=\"fpol\" type=\"text\" size=\"10\" /></td>"
."  </tr>"
."</table>"
."</fieldset><br>";
      echo"<div align=\"center\">"
         ."  <center>"
         . "  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"25%\" id=\"AutoNumber1\">"
         . "    <tr>"
         . "      <td width=\"20%\">"
         . "      <p align=\"center\">";
         echo "                  <a onmouseover=\"document['fpAnimswapImgFP3'].imgRolln=document['fpAnimswapImgFP3'].src;document['fpAnimswapImgFP3'].src=document['fpAnimswapImgFP3'].lowsrc;\" onmouseout=\"document['fpAnimswapImgFP3'].src=document['fpAnimswapImgFP3'].imgRolln\" href=\"menu.php?gpo=$gpo&cia=$cia\">";
        echo "                  <img border=\"0\" src=\"../images/regresar-on.jpg\" id=\"fpAnimswapImgFP3\" onkeypress=\"return tabular(event,this)\" name=\"fpAnimswapImgFP3\" dynamicanimation=\"fpAnimswapImgFP3\" lowsrc=\"../images/regresar-on.jpg\" ></a>"
 . "                     <td td width=\"50\"> <p align=\"center\">"
          ."<input type=\"image\" src=\"../images/spacer.jpg\" name=\"sub\">"
 . "                     <td td width=\"50\"> <p align=\"center\">"
         . "      <td width=\"20%\">"
         . "      <p align=\"center\">"

     ." <input type=\"image\" src=\"../images/agregar.jpg\" name=\"Submit\" value=\"\">"
         . "    </tr>"
         . "  </table>"
         . "  </center>";
?>
si quieren verlo en linea aqui les pongo el link

http://www.contamax.com/contab/progs....php?gpo=&cia=

Gracias por la ayuda que me puedan brindar.
  #2 (permalink)  
Antiguo 28/04/2008, 11:07
Avatar de Fann_Lavigne  
Fecha de Ingreso: diciembre-2004
Mensajes: 622
Antigüedad: 19 años, 4 meses
Puntos: 12
Re: Ayuda Pliz

Espero te haya entendido, revisate este hilo a ver si te sirve:

http://www.forosdelweb.com/f78/evita...-focus-571681/
__________________
"Entre Mas Brillante Es Una Mente, Tiene Que Luchar Contra Demonios Internos Mas Poderosos"
[email protected]
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 17:34.