Jump to content


Photo

Formulário Flash Com Validação


  • Faça o login para participar
7 replies to this topic

#1 christie5

christie5

    Novato no fórum

  • Usuários
  • 13 posts
  • Sexo:Não informado
  • Interesses:Design gráfico<br>Web design<br>Fotografia<br>Decoração

Posted 04/10/2006, 19:33

Olá,

Estou sofrendo para fazer um form no flash. Preciso que ele avise caso um dos campos não seja preenchido, e seja enviado por PHP para mais de um e-mail, escolhido através de um combobox.

Já tinha feito anteriormente um formulário em flash+php, mas sem validação, que funcionava bem. Tentei unir o script que já tinha com outro, mas não deu certo.

o arquivo em flash está aqui

e o php está abaixo:

<?php
$recipient = $_POST["onde"];
$subject = "Contato UBS";
$msg = "Nome: " . $_POST["nome"] . "\n\nE-Mail: " . $_POST["email"] . "\n\nAssunto: " . $_POST["assunto"] . "\n\nMensagem" . $_POST["mensagem"];
$mailheaders = "From: " . $_POST["email"];
mail($recipient, $subject, $msg, $mailheaders);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>flashy mail: send form</TITLE>

</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<div align=center>

<p class=h2>Email enviado!</p>

<P>Obrigado, <?php echo "$sender_name"; ?> (<?php echo "$sender_email"; ?>), por ter enviado esta mensagem:</p>
<P><?php echo "$message"; ?></p>

</div>

</body>
</html>

Agradeço imensamente se puderem me ajudar! Obrigada, Chris

#2 Micheeel

Micheeel

    ...

  • Usuários
  • 383 posts
  • Sexo:Não informado
  • Localidade:Jaraguá do Sul - SC

Posted 05/10/2006, 10:44

Exemplo de como fazer mudar o fundo de um campo:
this.createTextField("first_txt", 1, 10, 10, 300, 20);
first_txt.border = true;
first_txt.type = "input";

this.createTextField("second_txt", 2, 10, 40, 300, 20);
second_txt.border = true;
second_txt.type = "input";

second_txt.onKillFocus =  first_txt.onKillFocus = function(newFocus:Object) {
	this.background = false;
};

second_txt.onSetFocus = first_txt.onSetFocus = function(oldFocus:Object) {
	this.background = true;
	this.backgroundColor = 0x33CC99;
}

Exemplo de como restringir alguns caracteres nos campos e verificar se não são vazios:
input_codarea.restrict = "0-9";
input_telefone.restrict = "0-9 \\-";
input_email.restrict = "a-zA-Z0-9@._\\-";

loadVarsPost = new LoadVars();
loadVarsPost.onLoad = function() { gotoAndStop("enviar"); }

btn_enviar.onRelease = function() 
{
	if (input_nome.text == "" ) 
	{
		input_erros.text = "Preencha o campo 'Nome'";
		break;
	} else if ( input_email.text == "" ) 
	{
		input_erros.text = "Preencha o campo 'E-mail'";
		break;
	} else if ( input_mensagem.text == "" ) 
	{
		input_erros.text = "Preencha o campo 'Mensagem'";
		break;
	} else
	{
		loadVarsPost.nome	 = input_nome.text;
		loadVarsPost.email	= input_email.text;
		loadVarsPost.codarea  = input_codarea.text;
		loadVarsPost.telefone =	input_telefone.text;
		loadVarsPost.mensagem = input_mensagem.text;
		loadVarsPost.sendAndLoad("enviar_faleconosco.php", loadVarsPost, "POST");
		gotoAndStop("enviando");
	}
}

Com esses 2 codigos já da pra ter uma ideia de como funciona, só juntar os 2.

Referente a restriçao dos campos, ali ele só verifica se são vazios, e como o flash 8 não tem expressão regular (flash 9 com ActionScript 3 tem), não dá pra fazer algo mto complexo sem ter mto trabalho de implementação.

Sugiro fazer a verificação dos campos no PHP mesmo e informar que foram preenchidos incorretamente com expressão regular (+ complexo e certeiro).

Exemplo de eregi no PHP (expressões regulares):
if (!ereg("^[A-Za-zÀ-ú]{2,}[A-Za-zÀ-ú ]*$", $_SESSION['nome'])) 
			{
				$erros .= $sufixo . "nome";
				$sufixo = ", ";
			}
				
			if (!ereg("[A-Z]{2}", $_SESSION['pais']))  
			{
				$erros .= $sufixo . "país";
				$sufixo = ", ";
			}
			
			if (!ereg("^[A-Za-zÀ-ú]{2}[A-Za-zÀ-ú ]*$", $_SESSION['cidade']))   
			{
				$erros .= $sufixo . "cidade";
				$sufixo = ", ";
			}
				
			if (!ereg("^[A-Za-zÀ-ú]{2,}[A-Za-zÀ-ú ]*$", $_SESSION['estado']))   
			{
				$erros .= $sufixo . "estado";
			

[]'s
Michel

Posted Image

#3 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 22/09/2017, 17:08

Cialis E Tiroide cialis Levitra Casero Misoprostol Buy Zithromax At Walgreens online pharmacy Amoxicillin For A Cat
Bentyl Spastic Colon cialis Cialis Online Pharmacy
Secure Cheap Amoxicilina Discount Canada Amex Cod Accepted
Kamagra Marbella <a href=http://cialtobuy.com>cialis</a> Price Of Zithromax

#4 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 23/09/2017, 01:05

Cialis Generique Montreal online pharmacy Provera Website Amex Overseas
Viagra Schweiz Rezept Amoxicillin For Infected Porcipine Quills Is Generic Cialis Safe
Viagra Und Andere Potenzmittel online pharmacy Isotretinoin Isotrex

#5 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 29/09/2017, 05:53

Viagra Senza Ricetta Yahoo Canada Pharmacies Free Shipping cialis Viagra E Varicocele Cialis Pharmacie Lyon Doxycycline For Dogs Pet Meds
Alternativa A Propecia Priligy Mutuabile Generic Cialis Reviews generic cialis Safety Of Zithromax In Pregnancy
Bentyl With Free Shipping In Internet Overseas Pharmacy Viagra Ohne Rezept Kaufen In Berlin Viagra Super Active 3 8 Day Shipping online pharmacy Propecia Hiv

#6 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 01/10/2017, 10:05

Cialis Dosage Directions online pharmacy Propecia Infertilidad Efectos Secundarios
Order Cialis Online In Usa cialis Viagra Generique Pas Cher Levonorgestrel Viagra Prix Pfizer En Paris
Propecia En La Mujer cheap cialis Comprare Viagra Con Paypal Coreg

#7 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 09/10/2017, 08:33

Viagra Bestellen Bankuberweisung Priligy Packaging generic viagra Priligy Plm
Generic Viagra Canada Price viagra Denis

#8 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 05/11/2017, 06:13

Clomid Menstruations Achat De Kamagra Au Canada Viagra Frau Lust cialis Lioresal Generique 10mg
Finasteride Isotrex buy viagra online Find Secure Ordering Generic Pyridium Online Ups With Free Shipping
Venta De Baclofeno viagra online prescription Cephalexin For Sinus Infection




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq