[RESOLVED] Make connection betwewn Combo and Button
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
Re: Make connection betwewn Combo and Button
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.
Re: Make connection betwewn Combo and Button
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.
Re: Make connection betwewn Combo and Button
How can I do it by JavaScript?
Re: Make connection betwewn Combo and Button
Leave it as one target file and use a switch block in the PHP script based on the dropdown's value.