Duncan Disorderly Posted June 29, 2006 Share Posted June 29, 2006 Hi all,I want a "go menu" (on index) to load "data" (on data) in an "Iframe" (on info) and display selected data by moving to an anchor on the data page.Page1: Index.php with Form and go menuPage2: info.php with Iframe Id="InfoIframe" name="InfoIframe" src=data.phpPage3: data.php with various anchors and Data - Currency, Climate, Customs etcThis is my proposed form:<form name="Form_AB" method="POST"> id="CB_AB" name="CB_AB" <option value="0" SELECTED>Please Select</option><option value="1">Customs</option><option value="2">Currency</option><option value="3">Culture</option><option value="4">History</option><input type="submit" name="Button_AB" value="Go" id="Button_AB">1: Should I use "Submit" and "post" the form? 2: if so what would be the action "action=" ?3: Should I use "button" and onClick="document.location.href= 4: if so what would be the 'document.location.href='?Do I need to make other changes to ie: to the iframe src=data.php....etc ?or Is there a totally better way of achieiving this?Or can this not be done?thanks in advance for any constructive input or commentsKind regardsDD Quote Link to comment Share on other sites More sharing options...
xyn Posted June 29, 2006 Share Posted June 29, 2006 Basically you want a Page, when you click an option in the drop-down menu is shows-up in the "Iframe" which the IFrame would be page 2 and will show all the information from the "drop-down" ? Quote Link to comment Share on other sites More sharing options...
xyn Posted June 29, 2006 Share Posted June 29, 2006 Although I would recommend you used "GET" feature and set the information with a few links using the code below:[code]<?PHP$menu = $_GET['menu'];if( !$menu ){include("index_page");exit;} elseif( $menu == customs ) {include("customs.html");exit;} elseif( $menu == currency) {include("currency.html");exit;} elseif( $menu == culture ) {include("culture.html");exit;} elseif( $menu == history ) {include("history.html");exit;}else{die("Error: $menu does not exist");}?>[/code]the above code if placed in index.php would be used as:[a href=\"http://www.domain.com/index.php?menu=\" target=\"_blank\"]http://www.domain.com/index.php?menu=[/a][!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]Menu Name[!--colorc--][/span][!--/colorc--]the menu name defines which page is included; Each Link will apear as...index.php?menu=customsindex.php?menu=currencyindex.php?menu=cultureindex.php?menu=history[<a href="?menu=[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]Menu Name[!--colorc--][/span][!--/colorc--]">Link</a>]However. you could also edit the include(); with using echos. such as...[code]<?PHP$menu = $_GET['menu'];if( !$menu ){echo 'Index page';exit;} elseif( $menu == customs ) {echo 'customs';exit;} elseif( $menu == currency) {echo 'currency';exit;} elseif( $menu == culture ) {echo 'culture';exit;} elseif( $menu == history ) {echo 'History';exit;}else{die("Error: $menu does not exist");}?>[/code] Quote Link to comment Share on other sites More sharing options...
Duncan Disorderly Posted July 18, 2006 Author Share Posted July 18, 2006 Firstly, XYN :Thank you for your excellent example, unfortunately I believe I may have inadvertantly mislead you when I wrote "go menu".This Ladies and Gents is what I am trying to achieve: (without javascript if at all possible)Issue 1:I have a combo box with options (page titles) and button, I wish the user to select the options from the combo box and use this to load a page into an Iframe on the same page as the combo box. - similar to a go menu but use an IframeIssue 2As issue 1 but the Iframe is on a differant page.Issue 3I have a datapage, with paragraphs defined with anchors.I want to use the anchor titles as options in a combo box, I wish the user to be able to select an option and then use that selection to load the datapage into an iframe and move to the specified anchor.AdditionallyI know Iframes are frowned upon so any additional advice as to how to do this with Divs would be appreciated... Not asking much am I !!!!!!...CheersDD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.