Drop-Down Link Opens Inside Drop-Down List
-
Hi all,
I’ll start by saying I’m guessing this is because I’m using an iFrame, but I don’t know what other method I should be using.
On my page I have a drop-down list that shows an archive – clicking on an entry on this list is meant to take you to a separate page (in the same window), but instead it loads the new page within the drop-down list itself.
I don’t want to include the form code on every page as that would mean a lot of extra work every 3 months so I included it in a separate PHP file.
Here’s the code:
<iframe src="https://www.greencastleparish.com/wordpress/wp-content/themes/greencastleparish/newssheetarchive.php" style="border: 0px #FFF none; float: right; clear: both;" name="newssheetarchive" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="20px" width="213px"></iframe>
And this is in it’s own separate PHP file (I removed some of the entries here for the sake of readability):
<script> <!-- function JumpToIt(list) { var newPage = list.options[list.selectedIndex].value if (newPage != "None") { location=newPage } } //--> </script> <!-- archive list --> <div class="monthlist"> <form> <select name="select" onchange="JumpToIt(this)"> <option value="None">Select a month from the archive</option> <option value="https://www.greencastleparish.com/wordpress/native-priests">April to June, 2015</option> <option value="https://www.nialldevlin.com/newssheetarchive/2015/january-march.php">January to March, 2015</option> <option value="https://www.nialldevlin.com/newssheetarchive/2014/october-december.php">October to December, 2014</option> </select> </form> </div> <!-- monthlist -->
And here is the PHP file, incidentally it works fine straight from here.
Really hope someone can help me with this as it’s been puzzling me for a long while.
- The topic ‘Drop-Down Link Opens Inside Drop-Down List’ is closed to new replies.