PDA

View Full Version : component's probleme combo box



emson
April 25th, 2007, 08:31 AM
hello, I encounter a problem on the level of sending of variables for the posting of the message, i have been able to recupere the values of the fields of txt, but those of the components"combobox & check box" in vain

this my code AS


_focusrect = false;

chek1.themeColor="haloBlue";
chek1.color=0xffffff;

chek2.themeColor="haloBlue";
chek2.color=0xffffff;


chek3.themeColor="haloBlue";
chek3.color=0xffffff;


chek4.themeColor="haloBlue";
chek4.color=0xffffff;

chek5.themeColor="haloBlue";
chek5.color=0xffffff;

chek6.themeColor="haloBlue";
chek6.color=0xffffff;

chek7.themeColor="haloBlue";
chek7.color=0xffffff;


chek8.themeColor="haloBlue";
chek8.color=0xffffff;



chek9.themeColor="haloBlue";
chek9.color=0xffffff;


chek10.themeColor="haloBlue";
chek10.color=0xffffff;

Name.text = " Votre Nom"
Surname.text = "Votre Prénom"
Email.text = "Votre Email"
Message.text = " Votre Message"


Clear.onRelease = function() { // vider les champs
region.text = "";
che.setSelectedIndex(0);
superficie.setSelectedIndex(0);
terrain.setSelectedIndex(0);
enveloppe.setSelectedIndex(0);

Name.text =""
Surname.text =""
Email.text = ""
Message.text =""

Name.text = " Votre Nom"
Surname.text = "Votre Prénom"
Email.text = "Votre Email"
Message.text = " Votre Message"

}
Submit.onRelease = function () {
var e_lv:LoadVars = new LoadVars();
var g_lv:LoadVars = new LoadVars();
e_lv.ad = Name.text;
e_lv.soyad = Surname.text;
e_lv.posta = Email.text;
e_lv.konu = che.selectedIndex;
e_lv.kona = superficie.selectedIndex;
e_lv.kone = terrain.selectedIndex;
e_lv.kono = enveloppe.selectedIndex;
e_lv.mesaj = Message.text;
if (Name.text eq "") {
gotoAndStop(3);
} else if (Surname.text eq "") {
gotoAndStop(3);
} else if (Message.text eq "") {
gotoAndStop(3);
} else if (Email.text eq "") {
gotoAndStop(3);
} else if (Email.text.indexOf("@") == -1 && Email.text.indexOf(".") == -1) {
gotoAndStop(3);
} else {
e_lv.sendAndLoad("contact_form.php", g_lv, "POST");
gotoAndStop(4);
}
}



code php




<?php

// Your Email Address
$toaddress = "addr@free.fr";


$fromname = $_POST['name'] . ' ' . $_POST['surname'];
$reg = $_POST['region'];
$fromaddress = $_POST['posta'];

if ($_POST['che'] == 0) {
$che = 'Types de construction';
} elseif ($_POST['che'] == 1) {
$che = 'Maison individuelles';
} elseif ($_POST['che'] == 2) {
$che = 'Extension un existant';
} elseif ($_POST['che'] == 3) {
$che = 'Aménager un existant';
} elseif ($_POST['che'] == 4) {
$che = 'Maisons individuelles groupés';
} elseif ($_POST['che'] == 5) {
$che = 'COmmerciale';
} elseif ($_POST['che'] == 6) {
$che = 'Industrielle';
} elseif ($_POST['che'] == 7) {
$che = 'Agricoles';
}

//////////////////////////////////////////////////////////////////////////////////////////

if ($_POST['superficie'] == 0) {
$superficie = 'Superficie du plancher';
} elseif ($_POST['superficie'] == 1) {
$superficie = 'de 50 à 100m²';
} elseif ($_POST['superficie'] == 2) {
$superficie = 'de 100 à 200m²';
} elseif ($_POST['superficie'] == 3) {
$superficie = '200 à 300m²';
} elseif ($_POST['superficie'] == 4) {
$superficie = 'Autres';
}

//////////////////////////////////////////////////////////////////////////////////////////

if ($_POST['terrain'] == 0) {
$superficie = 'Superficie du terrain';
} elseif ($_POST['terrain'] == 1) {
$superficie = 'Moins de 500m²';
} elseif ($_POST['terrain'] == 2) {
$superficie = 'de 500 à 1000m²';
} elseif ($_POST['terrain'] == 3) {
$superficie = 'de 1000 à 1ha';
} elseif ($_POST['terrain'] == 4) {
$superficie = 'Plus de 1ha';
}
//////////////////////////////////////////////////////////////////////////////////////////



$message = ($_POST['Message']);

$mailcontent = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
."<html dir=\"ltr\" lang=\"tr\">\n"
."<head>\n"
."<title>".$subject."</title>\n"
."<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\" />\n"
."<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\" />\n"
."<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache\" />\n"
."<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\" />\n"
."<style type=\"text/css\" media=\"all\">\n"
."body\n"
."{\n"
." color: #333333;\n"
." font-size: 12px;\n"
." font-family: Century Gothic, Trebuchet MS, Tahoma, verdana, arial, Helvetica, sans-serif;\n"
." margin: 2ex;\n"
." text-align: left;\n"
." background-color: #FFFFFF;\n"
."}\n"
."\n"
."a:link, a:visited\n"
."{\n"
." color: #FF6600;\n"
." text-decoration: none;\n"
." font-weight: bold;\n"
." font-size: 12px;\n"
." font-family: Century Gothic, Trebuchet MS, Tahoma, verdana, arial, Helvetica, sans-serif;\n"
."}\n"
."\n"
."a:hover\n"
."{\n"
." color: #336699;\n"
." text-decoration: none;\n"
." font-weight: bold;\n"
." font-size: 12px;\n"
." font-family: Century Gothic, Trebuchet MS, Tahoma, verdana, arial, Helvetica, sans-serif;\n"
."}\n"
."\n"
."</style>\n"
."</head>\n"
."<body>\n"
."\n"
."".$message."\n"
."\n"
."</BODY>\n"
."</HTML>\n";

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=utf-8\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: Eggdrop Inc.\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";

@mail($toaddress, $subject, $mailcontent, $headers);

?>



thank you for your attention

emson
April 27th, 2007, 07:50 AM
hello
there's someone who can help me for recupere data from "combo & check box "
tkx

borrob
April 27th, 2007, 08:27 AM
i'm not sure where this is going wrong but i think it quite obvious that
e_lv.konu = che.selectedIndex;
will set the value off e_lv.konu to the index not the value....
oh and then a question because it's a long time i wrote flash combo but is this a 0 based index? or a 1 based?

emson
April 27th, 2007, 10:10 AM
hi borob

do you have any exemple or idea for that cauz i'm beginner with the component this is my firs one
thank you