Comunidad de diseño web y desarrollo en internet online

Limpiar formulario de correo

Citar            
MensajeEscrito el 24 Nov 2006 09:40 am
no se.... no encuentro el fallo... no se en k me estoy ekivocando... me he tirado horas y horas y horas sin saber por kkkkkkkk


PROBLEMA: el formulario de NewsLetter.

1. No me limpia los campos, la orden Limpiar(); no me la coje bien, sólo me limpia el campo de nombre y en el msg de error/ok, pero NO el campo de E-mail nada de nadaaaa Y NO SE COMO CARAJO ARREGLARLO

en esta web podeis ver el problem:

http://www.ultrarun.es/


Agradecería a la persona que me pueda postear el código corregido o por lo menos indicarme en donde está el error... Me estoy volviendo loko de remateeee y es lo único k me keda para cerrar esta webbbbbbbbbb


Gracias

Dejo aki el Code

Código :

// --------------------------------------------------------------
// función que valida números
// --------------------------------------------------------------
String.prototype.isNumbers = function() {
   if (this.length<1) {
      return false;
   }
   for (i=0; i<this.length; i++) {
      code = this.charCodeAt(i);
      if (this.charAt(i) != " " && code<48 || code>57) {
         return false;
      }
   }
   return true;
};
// --------------------------------------------------------------
// valida mails
// --------------------------------------------------------------
String.prototype.isMail = function() {
   if (this.indexOf("@")>0 && this.indexOf("@") == this.lastIndexOf("@")) {
      if (this.lastIndexOf(".")>this.indexOf("@")+1 && this.lastIndexOf(".")<this.length-2) {
         return true;
      }
   }
};
// --------------------------------------------------------------
// función que limpia los campos
// --------------------------------------------------------------
function limpiar() {
   nom = "";
   mailFrom = "";
   mensaje_error ="";
}
// --
nombre.tabIndex = 1;
mail.tabIndex = 3;
// --
nombre.borderColor = 0x533423;
mail.borderColor = 0x533423;
msg.borderColor = 0x533423;
//
nombre.onSetFocus = function() {
   mensaje_error = "";
   nombre.backgroundColor = 0xFFFFCC;
};
nombre.onKillFocus = function() {
   nombre.backgroundColor = 0xF2D8B9;
};
// --
mail.onSetFocus = function() {
   mensaje_error = "";
   mail.backgroundColor = 0xFFFFCC;
};
mail.onKillFocus = function() {
   mail.backgroundColor = 0xF2D8B9;
};
//
bEnviar.onRollOver = bEnviar.onRollOver=function () {
   this.gotoAndPlay("sobre");
};
bEnviar.onRelease = function() {
   if (nom.length<1) {
      mensaje_error = "nombre?";
   } else if (!mail.text.isMail()) {
      mensaje_error = "e-mail?";
   } else {
      loadVariablesNum("form.php", 0, "POST");
      mensaje_error = "¡¡enviado!!";
      }

};
bEnviar.onRollOut = bEnviar.onRollOut=function () {
   limpiar();
};



Gracias de nuevo

~koballo~


[zah]Título editado. Usa títulos que describan tus problemas[/zah]

Por koballo

708 de clabLevel



 

safari
Citar            
MensajeEscrito el 24 Nov 2006 12:26 pm
Mira, en este caso yo mandaría limpiar la propiedad .text de cada uno de los campos.

Código :


// --------------------------------------------------------------
// función que valida números
// --------------------------------------------------------------
String.prototype.isNumbers = function () {
   if (this.length < 1) {
      return false;
   }
   for (i = 0; i < this.length; i++) {
      code = this.charCodeAt (i);
      if (this.charAt (i) != " " && code < 48 || code > 57) {
         return false;
      }
   }
   return true;
};
// --------------------------------------------------------------
// valida mails
// --------------------------------------------------------------
String.prototype.isMail = function () {
   if (this.indexOf ("@") > 0 && this.indexOf ("@") == this.lastIndexOf ("@")) {
      if (this.lastIndexOf (".") > this.indexOf ("@") + 1 && this.lastIndexOf (".") < this.length - 2) {
         return true;
      }
   }
};
// --------------------------------------------------------------
// función que limpia los campos
// --------------------------------------------------------------
function limpiar () {
   nombre.text = "";
   mail.text = "";
   mensaje_error = "";
}
// --
nombre.tabIndex = 1;
mail.tabIndex = 3;
// --
nombre.borderColor = 0x533423;
mail.borderColor = 0x533423;
msg.border = true;
msg.borderColor = 0x533423;
msg.backgroundColor = 0xFFFFCC;
//
nombre.onSetFocus = function () {
   mensaje_error = "";
   nombre.backgroundColor = 0xFFFFCC;
};
nombre.onKillFocus = function () {
   nombre.backgroundColor = 0xF2D8B9;
};
// --
mail.onSetFocus = function () {
   mensaje_error = "";
   mail.backgroundColor = 0xFFFFCC;
};
mail.onKillFocus = function () {
   mail.backgroundColor = 0xF2D8B9;
};
//
bEnviar.onRollOver = function () {
   this.gotoAndPlay ("sobre");
};
bEnviar.onRelease = bEnviar.onReleaseOutside = function () {
   if (nom.length < 1) {
      mensaje_error = "nombre?";
   } else if (!mail.text.isMail ()) {
      mensaje_error = "e-mail?";
   } else {
      loadVariablesNum ("form.php", 0, "POST");
      mensaje_error = "¡¡enviado!!";
   }
};
bEnviar.onRollOut = function () {
   limpiar ();
};

ay tambien he corregido los eventos de boton que tenías repetidos.
Espero que te sirva de algo.
Saludos.

Por antonio_L

161 de clabLevel



Genero:Masculino  

de Linares

firefox
Citar            
MensajeEscrito el 24 Nov 2006 01:19 pm
hola antonio....

gracias pero no me vaaaaaaaaa :cry:


no sólo eso si no que además deja de funcionar el botón bEnviar


:cry:

Por koballo

708 de clabLevel



 

safari

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.