<html> <!-- this is just so Experts Exchange can try syntax highlighting -->
<!-- this is the select object with onchange .innerHTML event -->
<select name="searchclassic_col1" id="searchclassic_col1" style="font-size:9px;" onchange="document.getElementById('searchclassic_col1_span').innerHTML='<a href=db.php?cmd=search_classic&sort='+this[this.selectedIndex].value+'>'+this[this.selectedIndex].text+'</a>'; createCookie('searchclassic_col1_value', this[this.selectedIndex].value, 7); createCookie('searchclassic_col1_text', this[this.selectedIndex].text, 7); location.reload(true);">
<option value="" selected="selected">select from list....</option>
<option value="" disabled="disabled"> </option>
<?php foreach ($searchclassic_columns_array as $name => $db_field) { ?>
<option value="<?php echo $db_field; ?>"><?php echo $name; ?></option><?php } ?></select> <!-- drop-down options acquired from PHP array -->
<!-- turned column names into PHP sessions so it remembers what users selected -->
<?php
// FUNCTION TO PARSE COLUMN NAME INTO DYNAMIC HYPERLINK. MUST BE DEFINED AFTER DECLARING JAVASCRIPT COOKES TO PHP SESSIONS (SEE ABOVE).
// THIS ALSO PARSES STORED SESSION VARIABLE INTO ROW NAME FOR DISPLAYING RESULTS.
function cookie_crumbler($column,$default_value) {
if (!$_SESSION[$column] || $_SESSION[$column] == "null") { return $default_value; } else { return $_SESSION[$column]; }
}
?>
<!-- this is one of the table rows with the <span> -->
<th><a href="db.php?cmd=search_classic&sort=<?php echo cookie_crumbler("searchclassic_col1_value","Status"); ?><?php if (!$_GET['dir']) { echo "&dir=DESC"; }?>">
<span id="searchclassic_col1_span"><?php echo cookie_crumbler("searchclassic_col1_text","Status"); ?></span>
<?php if ($_GET['sort'] == cookie_crumbler("searchclassic_col1_value","Status") && $_GET['dir'] == "") { ?><img src="img/inbox/up-arrow.gif" border="none" /><?php } else if ($_GET['sort'] == cookie_crumbler("searchclassic_col1_value","Status") && $dir = "ASC") { ?><img src="img/inbox/down-arrow.gif" border="none" /><?php } else echo ""; ?></a></th>
<!-- notice the <span> in the middle of the <a href> tag. This is what is causing the problem...in IE... -->
</html>
|