;

PDA

Click to See Complete Forum and Search --> : Check Box & Forms


bobgodwin
03-27-2007, 10:10 PM
How does one go about using a check box as a form variable? I'd need to make a form for my band site where you can use four check boxes to pick which CD & where (USA or Overseas) it's going to be sent. Not sure what to do though. It will also have a text box for their email.

dniezby
04-04-2007, 09:51 PM
How does one go about using a check box as a form variable? I'd need to make a form for my band site where you can use four check boxes to pick which CD & where (USA or Overseas) it's going to be sent. Not sure what to do though. It will also have a text box for their email.

Sorry for the slow response, I didn't see this post.

I need to know a few things about the checkboxes before this can be done so I will use some general values.

Place the checkboxes where you want them, delete the label and put whatever text you want on stage to signify their value. (OR you could use the label but I generally don't. The fonts look better if you just place it on stage and a text object)

Open the Properties menu for the checkbox and go to it's onChange option.

In that actionscript window place this code. Do this for each of the check boxes.
(I use php tags on the forum to add syntax highlighting)

If you want the value of the checkbox assigned to a variable:

if (this.getValue() == true){
product = "item name" // use your item's name here.
}
else {
product = ""; // Clears the variable if unchecked.
}


If you want the value of the checkbox assigned to a dynamic textfield:

if (this.getValue() == true){
product.text = "Item Name"; // use your item's name here.
}
else {
product.text = ""; // Clears the textbox if item unchecked.

dniezby
04-08-2007, 12:46 PM
Did this work for you?

bobgodwin
04-08-2007, 02:50 PM
Sorry for the late response. I just got to it a couple of days ago, and yes it does work. But only in Flash 6, and my site is built in Flash 8 (The boxes won't check in 7 or 8). I'm not sure if this is a script thing, or a bug of some kind (I built it with the new beta). I sent Bob an email with the file and .php, an was waiting to hear back. Again sorry for not getting back with you sooner and a big thanks for your reply.

dniezby
04-08-2007, 03:57 PM
Post your file and I'll take a look at it. Or you can email it dniezby@comcast.net (dniezby@NOSPAMcomcast.net)

Don't forget to remove the nospam part before trying to eMail.

bobgodwin
04-10-2007, 02:44 PM
Here are the files I have.

dniezby
04-15-2007, 03:33 AM
All fixed Bob...Check your PM for the files.

dniezby
04-17-2007, 01:19 AM
Are we still having problems or did we fix them?

bobgodwin
04-17-2007, 01:29 AM
Fixed. Just sent you a PM. The files are in beta. Should I post them anyway?

dniezby
04-17-2007, 02:06 AM
No need.
I think you can mark this tread RESOLVED. (Under thread tools)

Glad to help.

verbatim
05-01-2007, 08:25 AM
I surely would have liked to have seen the code for this solution! I am having the same problem in Flash 8. Am trying to create a checkbox for a contact form that calls a PHP file. But my checkbox won't check. I must need to enable it somehow, but have been searching.

Here's the code I have in frame 1:

myCheckBoxListener = new Object();
myCheckBoxListener.click = function(evt) {
form.myCheckBox = "yes";
}
myCheckBox.addEventListener("click",myCheckBoxListener);


on the submit button that goes with the checkbox, I have:

on (release) {
form.loadVariables("email.php", "POST");
}

Any help would be appreciated. Thanks so much.

dniezby
05-01-2007, 09:01 AM
You didn't read this thread did you? The answer to your question is the 2nd post.
http://board.flashkit.com/board/showpost.php?p=3842665&postcount=2

You're making it more complicated than it needs to be.

verbatim
05-01-2007, 04:22 PM
Yes. I did read it. That's the really, really sad part.

Open the Properties menu for the checkbox and go to it's onChange option.

When I do this in Flash 8, I do not see an onChange option anywhere. Not in the parameters part of the properties inspector, or the component inspector or anywhere else. There's what looks like a text box under labe, labelPlacement and selected in the properties inspector, but i cannot click inside of it.

I am customizing a template that a client purchased that will only allow me to publish in FLashplayer 6. If I try to publish higher, the page slider won't work. And I've spent way too much time on this project already. Do you think there could be a compatibility issue? Or am I just that stupid.

Can I manually build a checkbox and not use the component?

Thanks.

dniezby
05-01-2007, 05:57 PM
Yes. I did read it. That's the really, really sad part.

When I do this in Flash 8, I do not see an onChange option anywhere. Not in the parameters part of the properties inspector, or the component inspector or anywhere else. There's what looks like a text box under labe, labelPlacement and selected in the properties inspector, but i cannot click inside of it.

I am customizing a template that a client purchased that will only allow me to publish in FLashplayer 6. If I try to publish higher, the page slider won't work. And I've spent way too much time on this project already. Do you think there could be a compatibility issue? Or am I just that stupid.

Can I manually build a checkbox and not use the component?

Thanks.
Wait...are you using Koolmoves or Flash? If you're using flash, you're in the wrong forum. If you're using Koolmoves then the on Changed option is right here in the component's options dialog
http://nsfilms.com/imgs/onChange.png

If you make a copy of the template available maybe we will be able to see your issue a little better. Though it sounds like you're in the wrong forum. This is a Koolmoves support forum.

verbatim
05-01-2007, 06:14 PM
I am most definitely in the wrong forum. Thanks for your time, though. I don't know what Koolmoves is, so I blew right by that in the breadcrumbs. Sorry.

ugh. The search continues. Thanks again.