PDA

Click to See Complete Forum and Search --> : [RESOLVED] Make connection betwewn Combo and Button


onh1986
Sep 10th, 2006, 04:29 AM
Hello
How can I make connection betwewn ComboBox and Button.

Example:
ComboBox contains 3 choices, they are A,B and C.

I have this code:
echo "<form action=file.php method=post>";

"file.php" is a variable according to ComboBox choice.

When I choose "A",
echo "<form action=a.php method=post>";

When I choose "B,
echo "<form action=b.php method=post>";

But wen I choose "C",
echo "<form action=c.php method=post>";


Did you get it?
How can I do it?
Thanks & Regards

kfcSmitty
Sep 10th, 2006, 09:56 AM
If you're trying to do this on the fly, I believe you would have to use AJAX, and I have no experience with that.

If you want to do it using nothing but PHP, you will need to submit the form that contains the combobox, and display the appropriate post based off the value submitted.


Try that, and post the code you have thus far. I will try to help you.

CornedBee
Sep 10th, 2006, 11:19 AM
No need for AJAX, simple JavaScript should suffice. But as Smitty said, on the PHP side you can only do it via a post-back, or a server-side forwarding scheme depending on the value of the combobox.

onh1986
Sep 10th, 2006, 11:24 AM
How can I do it by JavaScript?

penagate
Sep 11th, 2006, 06:23 AM
Leave it as one target file and use a switch block in the PHP script based on the dropdown's value.