|
-
Sep 10th, 2006, 04:29 AM
#1
Thread Starter
Addicted Member
[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
-
Sep 10th, 2006, 09:56 AM
#2
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.
-
Sep 10th, 2006, 11:19 AM
#3
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 10th, 2006, 11:24 AM
#4
Thread Starter
Addicted Member
Re: Make connection betwewn Combo and Button
How can I do it by JavaScript?
-
Sep 11th, 2006, 06:23 AM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|