Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-09-2012, 02:50 PM   #1
BlueRocker
Registered User
 
Join Date: Apr 2008
Posts: 11
Default [AS3] Passing Radio Button value to database

I have a simple form that passes its text fields to a PHP file that then adds them to a database. All of the text fields work but I do not know how to pass the info from a radio button to the database.

Because its just 2 radio buttons, I just manually added them to the stage from the components window. Then in my ActionScript 3 code I said:

ActionScript Code:
var testing:RadioButton;

naming the radio button groupName "testing".

Then in the rest of the code where I call the text fields I write

ActionScript Code:
function submitToPHP() {     var url:String = "submit_to_db.php";     var variables:URLVariables = new URLVariables();     variables.to_name = to_box.text; variables.from_name = from_box.text; variables.testing = testing;

The database is set up to accept the form field as a "varchar".

There is more code that makes all of this work but those are the pieces that involve the radio buttons. Hopefully this makes sense but if it would help for me to show all of my code or anyone has a tutorial on creating forms with check boxes and radio button that integrate into a database, I would appreciate it.
BlueRocker is offline   Reply With Quote
Old 05-10-2012, 06:04 PM   #2
svenjoypro
DontJustEnjoyIt,SvEnjoyIt
 
svenjoypro's Avatar
 
Join Date: Sep 2005
Location: California
Posts: 1,388
Default

I would just send the label or the instance name of the radio button (a string variable). And if you need to read back that data from php, just check off the radio button with that label name or instance name.
svenjoypro is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:52 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.