Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 18th, 2003, 05:02 PM
IonZoft IonZoft is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 26 IonZoft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 6 m 11 sec
Reputation Power: 0
Exclamation Flash MX Combo Box Component

Hey I'm trying to create a flash form that contains some combo boxes. How do I pull the current data off the combo box and send it to php? Also, the default value of the combo box is blank, so how to I validate it when the user clicks "submit" to ensure he has selected an option.

Thanks.

Reply With Quote
  #2  
Old December 18th, 2003, 05:53 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,417 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 23 h 21 m 9 sec
Reputation Power: 496
Facebook MySpace
Hi, found this which answers half of your question

Getting variables from a combo box into php

The gist of it is:

function getthevalue() {
passthis = mycombobox.getSelectedItem();
loadVariablesNum ("myfile.php", "0", "POST");
}

Now to check validate the user data you can be very specific i.e.

function getthevalue() {
passthis = mycombobox.getSelectedItem();
if(passthis == "news" || passthis =="home" || passthis == "fred")
{
loadVariablesNum ("myfile.php", "0", "POST");
}
else if(passthis == "tom")
{
loadVariablesNum ("tomsfile.php", "0", "POST");
}
else{
_root.messageBox.text = "please select an option";
}
}

If your not to fussed to check that closely then you can just use:

function getthevalue() {
passthis = mycombobox.getSelectedItem();
if(passthis != "")
{
loadVariablesNum ("myfile.php", "0", "POST");
}
else{
_root.messageBox.text = "please select an option";
}
}
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old December 19th, 2003, 09:39 AM
IonZoft IonZoft is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 26 IonZoft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 6 m 11 sec
Reputation Power: 0
Thanks for the advice. You have solved my problems. I send many thanks and Holiday Wishes your way!

Reply With Quote
  #4  
Old January 11th, 2004, 11:52 AM
mustang1308 mustang1308 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 63 mustang1308 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 46 m 57 sec
Reputation Power: 5
Which string do we have to put in the php file regarding the selected label in the combo box?

PHP file will look like this:
<?php
{
$db = mysql_connect("localhost", "DB", "Password");
mysql_select_db("DB");

$sql = "INSERT INTO Table (field1,field2,field3) VALUES ('$??????','$var2','$var3')";

$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
}
?>


The '$??????' should be the selected label of the combobox; I tried with '$passthis' and '$mycombobox' but it doesn't work. What is the good parameter?

My Flash code for the submit button is :

on (release) {
if (this.var2 == '' || this.var2 == null || this.var3 == '' || this.var3 == null) {
this.messok = 'Please make sure that ...';
} else {
function getthevalue() {
passthis = mycombobox.getSelectedItem();
loadVariablesNum ("http://url/myphp.php", 0, "POST");}
messok = "Thank you for your interest. ";
}
}

The Flash code for the combo box is:
form = new Object();
form.change = function (evt){
trace(evt.target.selectedItem.label);
}
mycombobox.addEventListener("change", form);

Thanks in advance.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash MX Combo Box Component


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway