I have some code that first selects an option value in a dropdown menu based on a query string contained in a link on another page:
<form action="" method="post" name="program" class="program">
<?php
$options = array('football1' => 'Football', 'baseball1' => 'Baseball', 'basketball1' => 'Basketball', 'hockey1' => 'Hockey', 'soccer1' => 'Soccer');
echo '<select name="name" size="1" onchange="ShowHide(this.value);">';
foreach($options as $clinic => $name) {
if(array_key_exists('clinic', $_GET) && $_GET['clinic'] === $clinic) {
echo '<option selected="selected" value="'.$clinic.'">'.$name.'</option>';
}
else {
echo '<option value="'.$clinic.'">'.$name.'</option>';
}
}
echo '</select>';
?>
</form>
What this does is take the referring link, such as www.mysite.com/sports?clinic=soccer1, and select the specified option value on the page load. The result is that the dropdown menu cycles through registration forms. The forms are in layered iframes, and when a different clinic is selected, its z-index increases and moves its form to the top. However, I need to edit the following code so that the iframe that initially has the z-index attribute is also based on the referring link:
<iframe id="football1" style="z-index:1;" src="www.mysite.com/football"></iframe>
<iframe id="baseball1" src="www.mysite.com/baseball"></iframe>
<iframe id="basketball1" src="www.mysite.com/basketball"></iframe>
<iframe id="hockey1" src="www.mysite.com/hockey"></iframe>
<iframe id="soccer1" src="www.mysite.com/soccer"></iframe>
Everything worked fine before because I always had the first item, football1, on top to begin with. But now that people will be coming to specific sports, I need that z-index to be able to start in any of the iframes. I assume it depends on whether the $clinic variable from the dropdown menu is defined. If it is undefined, then the z-index will still default to the first item. If not, it will be attributed to whatever clinic the link came to. I just have no idea how to execute this. Thanks.
Why don’t you adapt the same code you use for the
selectdropdown element? The logic is exactly the same: