Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP form/frame code prob.

Options
  • 21-03-2006 1:34pm
    #1
    Registered Users Posts: 1,987 ✭✭✭


    i have a page which is made of frames, in the left frame i have a drop down box and when i select an option from the drop down menu and then click the submit button i want it to load the page associated with the selected name into the right frame???


Comments

  • Registered Users Posts: 1,821 ✭✭✭Skud


    in the form header put TARGET="_right" I believe

    So you have <form name="sopmething" method="get" action="something.php" target="_right">

    I think, it's along those lines anyway


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    Skud wrote:
    in the form header put TARGET="_right" I believe

    So you have <form name="sopmething" method="get" action="something.php" target="_right">

    I think, it's along those lines anyway

    i got this far, the main prob is how do i put the page i want to load into the action part of the tag depending on what is picked in the drop down menu?


  • Registered Users Posts: 919 ✭✭✭timeout


    Try soemthing like:

    <form name="sopmething" method="get" action="<?php $destination ?>" target="_right">

    Where $destination will be assaigned depending on drop-down value. Define $destination with the default page in case that is the one they want and don't need to use the dropdown list. E.G. most drop-down boxs leave first value displayed.
    I don't think the above syntax is correct but its along those lines.


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    i've done that but no matter what i try i cant seem to asign the selected item from the drop down menu to the $destination variable!


  • Registered Users Posts: 919 ✭✭✭timeout


    Right, then use a redirect page.
    <form name="sopmething" method="get" action="redirect.php" target="_right">

    The redirect.php page will pull the value from the dropdown,find the page you want and redirect you to the that page.


  • Advertisement
  • Moderators, Politics Moderators Posts: 39,799 Mod ✭✭✭✭Seth Brundle


    the action attribute of the form is to tell it the destination. An object within the form hasn't the capability of dictating where the form goes.

    Incidentally the target attribute of a form is not part of strict xhtml if you are trying to abide by it.

    the easiest way of redirecting someone based on a drop down selection is to use javaScript - [http://javascript.internet.com/navigation/jump-menu.html]


Advertisement