Results 1 to 5 of 5

Thread: [RESOLVED] Make connection betwewn Combo and Button

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    Resolved [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

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    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.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Location
    United States
    Posts
    157

    Re: Make connection betwewn Combo and Button

    How can I do it by JavaScript?

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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
  •  



Click Here to Expand Forum to Full Width