Formluar problem. Post problem.

Se Gadzilla's brugerprofil
Indmeldt: 07-11-2009
Indlæg: 5
Er offline

Hej Folkens,

Dejligt at være en del af flashforum.dk

Jeg har lige overtaget en flash fil men en formular.

Problemet er man først skal trykke på knappen og derefter trykke enter før den poster til næste side.

Den skal selvfølgelig bare poste ved tryk på enter knap eller ved tryk på knappen.

Her er koden. Jeg håber virkeligt I kan hjælpe.

På forhånd tak!

/Michael

on (rollOver) {
	gotoAndPlay("p1");
}
on (releaseOutside, rollOut) {
	gotoAndPlay("p2");
}
on (release) {
	Key.addListener (this);
function onKeyUp ()
{
	if (Key.getCode () == Key.ENTER)
	{
 
 
	if (email_text.text == "E-mail") {
		email_text.size = 24;
		status_txt.text = "Please Enter E-mail Address.";
	} else if (password_text.text == "password") {
		status_txt.text = "Please Enter Password.";
	//IF EMAIL IS INVALID RETURN A FALSE (CODE FOR EMAIL 
	//EMAIL VALIDATION IS LOCATED BELOW
	} else if (email_text.text.emailValidation() == false) {
		status_txt.text = "E-mail Address is Invalid.";
	} else {
		getURL("http://minurl.dk", "", "POST");
	}
 
	//EMAIL VALIDATION
String.prototype.emailValidation = function() {
	//check to see if atleast 5 characters
	if (this.length < 5) {
		return false;
	}
	//Check to see if there are illegal characters within the email
	invalidChars = "`!#$%^&*()[]{}|:;'\",<>";
	for (i=0; i<this.length; i++) {
		if (invalidChars.indexOf(this.charAt(i)) != -1) {
			return false;
		}
	}
	//Check to see if the symbol @ is present, and 
	//if its in a valid postition
	at = this.lastIndexOf("@");
	if (at<1 || (at == this.length-1)) {
		return false;
	}
	//Check to see if a period is present and if 
	//its in a valid position
	period = this.lastIndexOf(".");
	if (period<4 || (period == this.length-1)) {
		return false;
	}
	//Check to see if the @ symbol and period are 
	//within their valid positions.
	if (1>=period-at) {
		return false;
	}
	//Check to see if there are no two periods or 
	//@ symbols in a row
	for (i=0; i<this.length; i++) {
		if ((this.charAt(i) == "." || this.charAt(i) == "@") && this.charAt(i) == this.charAt(i-1)) {
			return false;
		}
	}
	return true;	
}
 
	}
}
 
 
 
 
 
}

Kommentarer

Se Gadzilla's brugerprofil
Indmeldt: 07-11-2009
Indlæg: 5
Er offline

Jeg har fundet ud af det. Very Happy

Tog kun et par timer.

Du kan roligt slette tråden admin.