Foros del Web » Programando para Internet » Javascript »

Error en internet explorer pero no en firefox!!!

Estas en el tema de Error en internet explorer pero no en firefox!!! en el foro de Javascript en Foros del Web. Buenas! soy nuevo en esto y estoy haciendo un pequeño formulario, que da como resultado un e-mail con el resultado de los campos requeridos. El ...
  #1 (permalink)  
Antiguo 12/11/2010, 05:22
 
Fecha de Ingreso: noviembre-2010
Mensajes: 1
Antigüedad: 13 años, 6 meses
Puntos: 0
Error en internet explorer pero no en firefox!!!

Buenas!
soy nuevo en esto y estoy haciendo un pequeño formulario, que da como resultado un e-mail con el resultado de los campos requeridos.

El hecho es que el formulario me funciona a la perfección com firefox, pero ni siquiera se visualiza en internet explorer. Me da un error en la parte del <script>

Pego el codigo por si alguien me pude ayudar ...

Thanks!

<body>
<style type="text/css">
form#formulariDades input{ border:1px solid #cccccc; background:#EDF4ED; } form#formulariDades textarea{ border:1px solid #cccccc; background:#EDF4ED; cols:80; } form#formulariDades select{ border:1px solid #cccccc; background:#EDF4ED; }</style>

<script language="JavaScript" type="text/javascript"><!--
function checkform()
{
var form=document.getElementById("formulariDades");
if (form.formvar01_Nom.value == "") {
alert( "Introdueix el teu nom" );
form.formvar01_Nom.focus();
return false ;
}
if (form.formvar02_PrimerCognom.value == "") {
alert( "Introdueix el teu primer cognom" );
form.formvar02_PrimerCognom.focus();
return false ;
}
if (form.formvar03_SegonCognom.value == "") {
alert( "Introdueix el teu segon cognom" );
form.formvar03_SegonCognom.focus();
return false ;
}
if (form.formvar04_Email.value == "") {
alert( "Introdueix una adreça de correu" );
form.formvar04_Email.focus();
return false ;
}
if (form.formvar05_DNI.value == "") {
alert( "Introdueix el teu número de DNI" );
form.formvar05_Comentari.focus();
return false ;
}
if (form.formvar07_Departament.value == "") {
alert( "Introdueix el teu departament" );
form.formvar07_Departament.focus();
return false ;
}
if (form.formvar08_Facultat.value == "") {
alert( "Introdueix el la teva facultat" );
form.formvar08_Fscultat.focus();
return false ;
}
if (form.formvar09_Relacio.value == "") {
alert( "Introdueix la teva relació contractual" );
form.formvar09_Relacio.focus();
return false ;
}
if ((form.formvar10_activitat1.checked==false)&&(form .formvar11_activitat2.checked==false)&&(form.formv ar12_activitat3.checked==false)&&(form.formvar13_a ctivitat5.checked==false))
{
alert( "No has escollit cap activitat" );
form.activitat1.focus();
form.activitat2.focus();
form.activitat3.focus();
form.activitat5.focus();
return false ;
}


return form.submit() ;
}

</script>
<b>Inscripción</b>

<form action="/servlet/Satellite?c=Page&amp;cid=1126248553427&amp;languag e=ca&amp;pagename=i-UAB%2FPage%2FTemplatePageiPopUpWindowNoLogin" id="formulariDades" method="post" name="formulariDades">
<input name="formmail_mailto" type="hidden" value="[email protected]" /> <input name="formmail_subject" type="hidden" value="suggeriments" /> <input name="formredirect_gotopage" type="hidden" value="ResultatFormulariIDES_ca" /> <input name="formprop_contenttype" type="hidden" value="text/plain; charset=UTF-8" /> <input name="formprop_xsltappling" type="hidden" value="XSLT_PATH_FORM_plain" /><br />

y bla bla bla ...
  #2 (permalink)  
Antiguo 12/11/2010, 06:24
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 2 meses
Puntos: 574
Respuesta: Error en internet explorer pero no en firefox!!!

Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <title>Documento sin t&iacute;tulo</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <script language="JavaScript" type="text/javascript"><!--
  5. function checkform(){
  6.     var form=document.getElementById("formulariDades");
  7.     if (form.formvar01_Nom.value == "") {
  8.         alert( "Introdueix el teu nom" );  
  9.         form.formvar01_Nom.focus();
  10.         return false ;
  11.     }
  12.     if (form.formvar02_PrimerCognom.value == "") {
  13.         alert( "Introdueix el teu primer cognom" );
  14.         form.formvar02_PrimerCognom.focus();
  15.         return false ;
  16.     }
  17.     if (form.formvar03_SegonCognom.value == "") {
  18.         alert( "Introdueix el teu segon cognom" );
  19.         form.formvar03_SegonCognom.focus();
  20.         return false ;
  21.     }
  22.     if (form.formvar04_Email.value == "") {
  23.         alert( "Introdueix una adreça de correu" );
  24.         form.formvar04_Email.focus();
  25.         return false ;
  26.     }
  27.     if (form.formvar05_DNI.value == "") {
  28.         alert( "Introdueix el teu número de DNI" );
  29.         form.formvar05_Comentari.focus();
  30.         return false ;
  31.     }
  32.     if (form.formvar07_Departament.value == "") {
  33.         alert( "Introdueix el teu departament" );
  34.         form.formvar07_Departament.focus();
  35.         return false ;
  36.     }
  37.     if (form.formvar08_Facultat.value == "") {
  38.         alert( "Introdueix el la teva facultat" );
  39.         form.formvar08_Fscultat.focus();
  40.         return false ;
  41.     }
  42.     if (form.formvar09_Relacio.value == "") {
  43.         alert( "Introdueix la teva relació contractual" );
  44.         form.formvar09_Relacio.focus();
  45.         return false ;
  46.     }
  47.     if ((form.formvar10_activitat1.checked==false)
  48.     && (form .formvar11_activitat2.checked==false)
  49.     && (form.formv ar12_activitat3.checked==false)
  50.     && (form.formvar13_a ctivitat5.checked==false)){
  51.         alert( "No has escollit cap activitat" );
  52.         form.activitat1.focus();
  53.         form.activitat2.focus();
  54.         form.activitat3.focus();
  55.         form.activitat5.focus();
  56.     return false ;
  57.     }
  58.  
  59.     return form.submit();
  60. }
  61. //-->
  62. <style type="text/css">
  63.     form#formulariDades input{
  64.         border:1px solid #cccccc;
  65.         background:#EDF4ED; }
  66.  
  67.     form#formulariDades textarea{
  68.         border:1px solid #cccccc;
  69.         background:#EDF4ED; cols:80; }
  70.    
  71.     form#formulariDades select{
  72.         border:1px solid #cccccc;
  73.         background:#EDF4ED;
  74.     }
  75. </head>
  76. <b>Inscripción</b><br />
  77. <form action="/servlet/Satellite?c=Page&cid=1126248553427&languag e=ca&pagename=i-UAB%2FPage%2FTemplatePageiPopUpWindowNoLogin" id="formulariDades" method="post" name="formulariDades" >
  78.     <input name="formmail_mailto" type="hidden" value="[email protected]" />
  79.     <input name="formmail_subject" type="hidden" value="suggeriments" />
  80.     <input name="formredirect_gotopage" type="hidden" value="ResultatFormulariIDES_ca" />
  81.     <input name="formprop_contenttype" type="hidden" value="text/plain; charset=UTF-8" />
  82.     <input name="formprop_xsltappling" type="hidden" value="XSLT_PATH_FORM_plain" />
  83. </form>
  84. </body>
  85. </html>

Necessitem el bla bla bla... es que els inputs que ens has posat son tots hidden ocults...

Necesitamos el bla bla bla... es que los inputs que nos pones son todos hidden ocultos.

Si agrego un input que no sea oculto lo veo en ff y en IE6.

Por lo demas no veo nada que pueda chocar con los distintos navegadores.

Esto

form.activitat1.focus();
form.activitat2.focus();
form.activitat3.focus();
form.activitat5.focus();

no tinen mucho sentido, vaya que el focus estará en activitat5 pero con esto

form.activitat5.focus();

tambien.

Te faltaba cerrar el comentario del script (//-->).

No puedo dicirte nada más con lo que nos pasas...

Sort!!!

Quim
  #3 (permalink)  
Antiguo 14/12/2010, 18:31
Avatar de p414  
Fecha de Ingreso: agosto-2009
Ubicación: casi casi casi... a un lado de la cuna...
Mensajes: 575
Antigüedad: 14 años, 8 meses
Puntos: 44
Respuesta: Error en internet explorer pero no en firefox!!!

y tuviste problema con el focus en el internet explorer?

Etiquetas: explorer, firefox, internet
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 08:09.