You've got two javascript problems. One affects all browsers but isn't as far as I can tell a fatal error in any of them:
Code:
<script type="text/javascript">
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
function replaceDefault(el){
if (el.defaultValue==el.value)} el.value = "Search Airlines"
</script>
The entire above script doesn't appear to be used at all, so I'd just get rid of it. The highlighted part is the error though, it should be:
Code:
function replaceDefault(el){
if (el.defaultValue==el.value) el.value = "Search Airlines"}
The other is IE only. IE hates writing to tables. You may be able to get it to do that if you are really careful and/or clever as to how you go about it. But here (which you show in your post):
Code:
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var SearchListDisplay = document.getElementById('searchspeciallist
');
SearchListDisplay.innerHTML = ajaxRequest.responseText;
}
}
using the innerHTML property of a tbody element:
Code:
<tbody id="searchspeciallist
">
<?php include "searchspeciallist.php"?>
</tbody>
to write to it is either not clever (perhaps too clever), and/or not careful enough for IE.
If you could write the entire table to a containing div:
Code:
<div id="searchspeciallist
">
<table>
<tr>
<th>Airline</th>
<th>Takes Bikes?</th>
<th>Included in Allowance?</th>
<th>Cost</th>
<th>Policy/Comments</th>
<th>Policy Rating</th>
</tr>
<tbody>
<?php include "searchspeciallist.php"?>
</tbody>
<script type="text/javascript">
function showpolicy(cellid){
document.getElementById(cellid).style.display = (document.getElementById(cellid).style.display != "table-row" ? "table-row" : "none");
}
</script>
</table>
</div>
Then it will work. The searchspeciallist.php page will need to be modified to write the entire table, rather than just the contents of its tbody element.
Also notice the highlighted script. That doesn't need to be there. It could just as easily be in the head of the page. At the very least, outside of the table, as its being there will probably cause some problems with it and/or the solution I'm proposing, once you implement said solution. And it can work just fine from somewhere else (preferably in the head).
Further, as table-row can cause problems as a display value in some browsers, it should be rewritten as:
Code:
<script type="text/javascript">
function showpolicy(cellid){
var s = document.getElementById(cellid).style;
s.display = s.display === 'none'? '' : 'none';
}
</script>
Bookmarks