# Php/flash checkbox values?

**URL:** https://forum.kirupa.com/t/php-flash-checkbox-values/48469
**Category:** Uncategorized
**Created:** [April 13, 2004, 8:51pm UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469 "2004-04-13T20:51:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![swamp](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@swamp](https://forum.kirupa.com/u/swamp)
#### Post date: [April 13, 2004, 8:51pm UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/1 "2004-04-13T20:51:35Z")

</div>

here another newb question 😕

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@mydomain.com";  
$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 🙂  
Thx allready, and again 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 12:07am UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/2 "2004-08-05T00:07:14Z")

</div>

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 …

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 3:56pm UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/3 "2004-08-05T15:56:01Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 6, 2004, 12:17am UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/4 "2004-08-06T00:17:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 6, 2004, 2:03pm UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/5 "2004-08-06T14:03:47Z")

</div>

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…

```php

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]);
	}
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 1:03am UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/6 "2004-08-09T01:03:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 12:47pm UTC](https://forum.kirupa.com/t/php-flash-checkbox-values/48469/7 "2004-08-09T12:47:15Z")

</div>

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