PDA

View Full Version : combobox selected value to php not working


paulo
05-11-2007, 11:39 AM
Hi,
I can send data from Flash to my PHP file but I cannot select an item from a combobox and send to php ? How is this done. If I use a trace statement when I select an item from the combobox it works fine.

//FLASH CODE:
county_cb.addItem({data:1, label:"Galway"});
county_cb.addItem({data:2, label:"Clare"});
county_cb.addItem({data:3, label:"Mayo"});

//SELECT ITEM IN COMBOBOX
function change(evt){
var selectCombo= evt.target.selectedItem.label
}
county_cb.addEventListener("change", this);

submit_btn.onRelease = function () {
var send_lv:LoadVars = new LoadVars();
send_lv.county = selectcombo;
send_lv.comments = comment_it.text;
send_lv.sendAndLoad("http://www.mywebsite.com/viewsoccer.php", result_lv, "POST");
}


//PHP CODE:
<?php
$to="[email protected]";
$subject= 'Checking Combobox';
$msg= "Comments : ".$_POST['comments']."\nFrom County: ".$_POST['county'];
mail($to,$subject,$msg);
?>

Thanks,
Paul