Foros del Web » Programando para Internet » Javascript »

problema con un botón

Estas en el tema de problema con un botón en el foro de Javascript en Foros del Web. hola amigos solicito su ayuda desesperadamente.... jeje tengo un problema con un boton el cual no me esta ejecutando la accion onclik y no me ...
  #1 (permalink)  
Antiguo 27/06/2010, 17:44
Avatar de ronnyra  
Fecha de Ingreso: diciembre-2009
Mensajes: 173
Antigüedad: 14 años, 4 meses
Puntos: 1
problema con un botón

hola amigos solicito su ayuda desesperadamente.... jeje

tengo un problema con un boton el cual no me esta ejecutando la accion onclik y no me toma los archivos en donde se realiza todo lo que quiero que haga... aqui les dejo el codigo
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Documento sin t&iacute;tulo</title>
  5.  
  6. <script type="text/javascript" src="js/validarParticipante.js"></script>
  7. <script type="text/javascript" src="ajax_inscrip/js_participantes.js"></script>
  8. </head>
Código HTML:
Ver original
  1. <form name="regis" id="regis" method="get" action="busqueda.php">
  2.   <div id='contenido'>
  3.     <table width="655" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
  4. <tr>
  5.            <td width="60" bgcolor="#DFDF00"></td>
  6.         <td width="150" bgcolor="#DFDF00">Nombre y Apellido</td>
  7.            <td width="120" bgcolor="#DFDF00">Codigo</td>
  8.            <td width="90" bgcolor="#DFDF00">Semestre</td>
  9.            <td width="120" bgcolor="#DFDF00">Programa</td>
  10.            <td width="133" bgcolor="#DFDF00" align="center">Accion</td>
  11.       </tr>
  12.          <?php
  13.  while($row3 =  @mysql_fetch_array($result)){
  14.  ?>
  15.          <tr>
  16.            <td height="26" bgcolor="#FFFFC6"><label>
  17.              <input name="Cod_Inscrip_Est" type="text" id="Cod_Inscrip_Est" value="<?php echo $row3["Cod_Inscripcion_Est"]; ?>" size="10" />
  18.            </label></td>
  19.            <td bgcolor="#FFFFC6"><label>
  20.              <input name="nombre_com" type="text" id="nombre_com" value="<?php echo $row3["Nombre1"];?> <?php echo $row3["Nombre2"];?> <?php echo $row3["Apellido1"];?> <?php echo $fila["Apellido2"];?>" size="25" />
  21.            </label></td>
  22.            <td bgcolor="#FFFFC6"><label>
  23.              <input name="Cod_Est" type="text" id="Cod_Est" value="<?php echo $row3["Cod_Est"]; ?>" size="20" />
  24.            </label></td>
  25.            <td bgcolor="#FFFFC6"><label>
  26.            <input name="Semestre" type="text" id="Semestre" value="<?php echo $row3["Semestre"]; ?>" size="15" />
  27.            </label></td>
  28.            <td bgcolor="#FFFFC6"><label>
  29.              <input name="Nom_Programa" type="text" id="Nom_Programa" value="<?php echo $row3["Nom_Programa"]; ?>" size="20"  />
  30.            </label></td>
  31.            <td bgcolor="#FFFFC6"><input type="button" name="Submit3" value="Agregar Participante" onclick="javascript: if(ValidarParticipante()){ AgregarParticipante('ContenidoParticipante');LimpiarBeneficiario();}" id="Submit3" /></td>
  32.          </tr>
  33.          <?php }?>
  34.         </table>
  35.             <br />  
  36.                   <div id='ContenidoParticipante'>                     
  37.                         <table width="100%" border="1" align="center" cellpadding="0" cellspacing="1">
  38.                           <tr>
  39.                             <td width="24%" bgcolor="#DFDF00"><div align="center">Participantes</div></td>
  40.                           </tr>
  41.                         </table>                           
  42.                   <div/>
  43.             <br />
  44.                         <table width="100%" height="0%" border="0" class="boton2">
  45.               <tr>
  46.                 <th width="14%">&nbsp;</th>
  47.                 <th width="33%"><input name="acepto" type="submit" class="boton2" id="acepto" title="Enviar" value="Guardar" disabled="disabled"/></th>
  48.                 <th width="7%">&nbsp;</th>
  49.                 <th width="32%"><input name="limpiar" type="reset" class="boton2" id="limpiar" title="limpiar" onclick="limpiar;" value="Limpiar"/></th>
  50.                 <th width="14%">&nbsp;</th>
  51.               </tr>
  52.             </table>
  53.   </div>
  54.   </div>
  55. </form>
  56. </body>
  57. </html>

el boton es este ahi esta pero lo pongo ya que no c como resaltar esa parte del codigo...
Código HTML:
Ver original
  1. <input type="button" name="Submit3" value="Agregar Participante" onclick="javascript: if(ValidarParticipante()){ AgregarParticipante('ContenidoParticipante');LimpiarBeneficiario();}" id="Submit3" />

por fa eh revisado y nada les agradezco su ayuda...
  #2 (permalink)  
Antiguo 27/06/2010, 18:24
 
Fecha de Ingreso: marzo-2010
Mensajes: 37
Antigüedad: 14 años, 1 mes
Puntos: 1
Respuesta: problema con un botón

pon los codigos javascript, a lo mejor por alli es el problema.
  #3 (permalink)  
Antiguo 27/06/2010, 18:28
Avatar de ronnyra  
Fecha de Ingreso: diciembre-2009
Mensajes: 173
Antigüedad: 14 años, 4 meses
Puntos: 1
Respuesta: problema con un botón

este es uno...

Código Javascript:
Ver original
  1. function ValidarParticipante()
  2. {
  3.     // variables que se envian
  4.     var Cod_Inscrip_Est=document.getElementById('Cod_Inscrip_Est');    
  5.     var nombre_com=document.getElementById('nombre_com');
  6.     var Cod_Est=document.getElementById('Cod_Est');
  7.     var Semestre=document.getElementById('Semestre');
  8.     var Nom_Programa=document.getElementById('Nom_Programa');
  9.    
  10.     if(Cod_Inscrip_Est.value == "")
  11.     {
  12.         alert("El Campo Codigo de inscripcion Está Vacío");
  13.         Cod_Inscrip_Est.focus();
  14.         return false;
  15.     }
  16.     if(nombre_com.value == "")
  17.     {
  18.         alert("El Campo nombre Está Vacío");
  19.         nombre_com.focus();
  20.         return false;
  21.     }
  22.     if(Cod_Est.value == "")
  23.     {
  24.         alert("El Campo codigo del estudiante Está Vacío");
  25.         Cod_Est.focus();
  26.         return false;
  27.     }
  28.     if(Semestre.value == "")
  29.     {
  30.         alert("El Campo semestre Está Vacío");
  31.         Semestre.focus();
  32.         return false;
  33.     }
  34.     if(Nom_Programa.value == "")
  35.     {
  36.         alert("El Campo Programa Está Vacío");
  37.         Nom_Programa.focus();
  38.         return false;
  39.     }
  40.     return true;
  41. }
este es el otro que es un ajax
Código Javascript:
Ver original
  1. function nuevoAjax1()
  2. {
  3.     /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
  4.     lo que se puede copiar tal como esta aqui */
  5.     var xmlhttp=false;
  6.     try
  7.     {
  8.         // Creacion del objeto AJAX para navegadores no IE
  9.         xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
  10.     }
  11.     catch(e)
  12.     {
  13.         try
  14.         {
  15.             // Creacion del objet AJAX para IE
  16.             xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  17.         }
  18.         catch(E)
  19.         {
  20.             if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
  21.         }
  22.     }
  23.     return xmlhttp;
  24. }
  25.  
  26.  
  27.    
  28. function AgregarParticipante(idSelectOrigen)
  29. {
  30.     // div donde carga el contenido
  31.     var contenido=document.getElementById(idSelectOrigen);
  32.    
  33.     var Cod_Inscrip_Est=document.getElementById('Cod_Inscrip_Est').value;      
  34.     var nombre_com=document.getElementById('nombre_com').value;
  35.     var Cod_Est=document.getElementById('Cod_Est').value;
  36.     var Semestre=document.getElementById('Semestre').value;
  37.     var Nom_Programa=document.getElementById('Nom_Programa').value;
  38.    
  39.  
  40.     // Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen
  41.     var ajax=nuevoAjax1();
  42.     ajax.open("GET", "ajax_inscrip/tabla_participantes.php?accion=0&Cod_Inscrip_Est="+Cod_Inscrip_Est+"&nombre_com="+nombre_com+"&Cod_Est="+Cod_Est+"&Semestre="+Semestre+"&Nom_Programa="+Nom_Programa, true);
  43.    
  44.     ajax.onreadystatechange=function()
  45.     {
  46.         if (ajax.readyState==1)
  47.         {
  48.             contenido.innerHTML="Cargando...";                 
  49.         }
  50.         if (ajax.readyState==4)
  51.         {
  52.             contenido.innerHTML=ajax.responseText;
  53.         }
  54.     }
  55.     ajax.send(null);   
  56. }
  #4 (permalink)  
Antiguo 27/06/2010, 21:21
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Tema movido desde PHP a Javascript

Etiquetas: Ninguno
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 09:10.