Php/flash checkbox values?

here another newb question :confused:

i created a flashform that has textfields and checkboxes, the flashform paste the textfield data into a php file without any problem, but im stuck on the checkboxes, i dont know how to post them into the php.

this is the actionscript from my “send” button in flash :

on (release) {
loadVariablesNum(“form.php”, 0, “POST”);
gotoAndStop(2);
}

and this is the script i use in the php :

<?
$to = "[email protected]";
$subject = “offerte aanvraag”;
$msg = "Mijn naam is $naam
";
$msg .= "Mijn email adres is $email
";
$msg .= "Ik woon op de $straatnaam te $woonplaats
";
$msg .= "Ik ben te bereiken op telefoon nummer $telefoon

";
$msg .= "We willen huren op $verhuurstart tot en met $verhuurstop

";

$msg .= "kop en schotels $kopschotel
";
$msg .= "gebaksbordjes $gebaksbordjes
";

$msg .= "Vragen/opmerkingen $opmerkingen

";
mail($to, $subject, $msg );
?>

can this script GET the values ?, or does the send button needs more action script ?

Iff any of you guru´s know the answer, pls gimme a good hint :slight_smile:
Thx allready, and again :slight_smile:

I’ve got the same problem and posted on 15 forums still not a single reply like it’s not doable , found just some tips which don’t seem to be clear or don’t work… strange …

You need to specify what variable you want to send when it comes to the data from the components like comboBox or checkBox…

You can use FCheckBox.getLabel() or FComboBox.getSelectedItem() for instance…

I suggest you use LoadVars() object instead of loadVariables() function though…

hi,

well the thing is I can get the checkbox to pass state (didn’t work it out for radio buttons yet?) but the problem is it passes the very first state so if uses clicks same checkbox few times it still passes only very first change of state which is “Yes” (ticked)

function onSelectAll(checkbox) {
checkBox1 = (check1.getValue() ? “No” : “Yes”);}

now I need to check the change of state using change handler somehow but i don’t know how ??? I tried this but it didn’t work and tried picking up ‘checkBox1’ in php mailer script as checkBox1 …

//on submit button
check1.setChangeHandler(“onSelectAll”);

function onSelectAll(checkbox) {
checkBox1 = (check1.getValue() ? “No” : “Yes”);}

Any ideas ???

cheers

Uh… This might get you going abit further???

Create three checkBox instances on the stage and name them ‘check1’, ‘check2’ and ‘check3’ and paste this script…


for (var i = 1 ; i <= 3 ; i++)
{
	_level0["check" + i].setChangeHandler("onSelectAll"); 
}
 
function onSelectAll() 
{
	trace("-----------");
	for (var i = 1 ; i <= 3 ; i++)
	{
		_level0["checkBox" + i ] = (_level0["check" + i].getValue() ? "Yes" : "No");
		trace("_level0[\"checkBox\" + i ] = " + _level0["checkBox" + i ]);
	}
}

well I’m bit confused with your code but I the checkoboxes working with listeners
myCheckboxListener = new Object();
myCheckboxListener.click = function (eventObject)
{
//if checkbox selected assign value yes
if (check1.selected)
{ checkBox1 = check1.getValue() ? “No” : “Yes”; }
… etc
}
check1.addEventListener(“click”, myCheckboxListener);

it works fine, but I can’t get the grip on radio Buttons especially because I need quite few different radio groups … how do listeners work with radios ???

cheers

I can’t really say how it works because I don’t use FMX 2004…
Anybody want to give some hands to Trippin??? :slight_smile: