I posted this in the HTML forum, but it was suggested I post it over here as well by a moderator.
I have a form that will not 'fire' in non-IE browsers?? I have poked and poked at the code and can not find why.
The AJAX changes the query button in non-IE browsers, at least in the sense it is not opaque anymore, the 'title' check changes, etc - it just doesn't "fire" when you click the icon/image in Mozilla, etc but DOES in Internet Explorer...
That is
[PHP]if(array_key_exists('_submit_check', $_POST))[/PHP]
is never to be true in non-IE browsers, but works just fine in IE???
Note that I have ANOTHER form on another page where the code below is the same (triple checked side-by-side) BUT it DOES work in Firefox, etc - suggesting that the issue on the page that doesn't work is not in this part of the code... but have no idea where!!!
So basically - any suggestions on to how to troubleshoot this?? What should I be looking for?
TIA!!
Greg...
--------------------------------------------
HTML/PHP page for from, trimmed and munged a little
[HTML]
<!DOCTYPE htm
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>
<head>
<title>[munge] DMS Portal - Text Data Query - Hydraulic Testing</title>
<!-- add the 'standard' HEADER portions-->
<?php
include("standard_format_items/header_portions.php");
?>
<!-- the 'entry' to the code to populate the 'chained' pulldowns for the hydraulic testing query parameters, via AJAX -->
<script language="JavaScript" src="AJAX/hydraulic_test_query/hydraulic_test_pulldowns_select.js"></script>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#0000ff">
<!-- add the 'standard' TOP logos, navigation bar, etc-->
<?php
$page_status = "β"; // adjust the page 'status' as relevant - alpha, beta, or nbsp
include("standard_format_items/top_navigation_bar.php");
?>
<br />
<table align="center" frame="box" rules="none" cellpadding="10" cellspacing = "0" width="800">
<tr class="header">
<td align="center" style="font-size:14pt; font-weight:bolder">
HYDRAULIC TESTING DATA - 'Text' Query Functionality
</td>
<td align="center" width="100">
<img src="images/icon_hydraulic.gif" alt="[hydraulic testing icon]">
</td>
</tr>
</table>
<?php
//SET UP THE 'GENERIC' DATABASE CONNECTION
$db_connect=pg_pconnect("host=[munge] dbname=[munge] user=[munge] password=[munge]") or die(pg_last_error($db_conn));
//SUM of SITE/LOCATION/s that that have HYDRAULIC TESTING data ('raw' and maybe analysis results); concatentate the site + location data for user 'comprehension' on the site and to simply the 'coding'
$SQL_Query = " SELECT (d_site.site_id || ' / ' ||d_location.location_id) AS label
FROM d_hydraulictest INNER JOIN (d_bore INNER JOIN (d_site INNER JOIN d_location ON d_site.site_id = d_location.site_id) ON (d_location.location_id = d_bore.location_id) AND (d_bore.location_id = d_location.location_id)) ON (d_hydraulictest.bore_id_test = d_bore.bore_id) AND (d_hydraulictest.bore_id_test = d_bore.bore_id)
GROUP BY d_site.site_id, d_location.location_id
ORDER BY d_site.site_id, d_location.location_id";
$query_result=pg_query($db_connect, $SQL_Query);
$row_counter_label=0;
while($row_data=pg_fetch_array($query_result)) {
$row_counter_label += 1;
$ary_query_result_SUM_site_plus_loc[$row_counter_label] = $row_data['label'];
}
?>
<br />
<!-- PULLDOWN/SELECTION TABLE -->
<table frame="box" rules="all" cellpadding="10" cellspacing="0" align="center">
<form action="<?PHP print $_SERVER['PHP_SELF']; ?>" method="post" name="data_select">
<input type="hidden" name="_submit_check" value="1" />
<tr class="header_select" style="font-weight:bold" valign="middle">
<td align="center">
<div id="site_location_title">
<div style="color:red">
Select<br />SITE / LOCATION
</div>
</div>
</td>
<td align="center">
<div id="test_date_start_title">
<div style="color:gray">
Select<br />DATE of<br />TEST START
</div>
</div>
</td>
<td align="center">
<!-- no 'title' needed -->
</td>
</tr>
<tr valign="middle">
<td>
<!-- site/location selection -->
<select name="site_plus_location" size="4" onchange="fun_get_test_dates(this.value)">
<?php
foreach($ary_query_result_SUM_site_plus_loc as $option_string) {
print "<option value=\"$option_string\">$option_string</option>";
}
?>
</select>
</td>
<td align="center">
<div id="test_dates">
<select size="4" style="color:gray; font-variant:italic">
<option>{select the site / location}</option>
</select>
</div>
</td>
<td align="center">
<div id="query_execute_icon">
<img src="images/icon_search2.gif" alt="INACTIVE: Submit Query" title="Select EVERY PARAMETER/s to Allow Query Execution" style="filter:alpha(opacity=35);-moz-opacity:0.35;opacity:0.35" />
<div style="font-style:italic; font-size:7pt; color:lightgray">
<br />Submit Query
</div>
</div>
</td>
</tr>
</form>
</table>
<?php
//ONCE PARAMETERS HAVE BEEN SELECTED BY THE USER, GET THE VARIOUS DATASETS FROM THE DATABASE AND SHOW IN THE THREE TABLES
if(array_key_exists('_submit_check', $_POST))
{//USER SELECTION HAS BEEN MADE
// [snipped things to do]
}
//DELETE ME - 'TEST CODE'
if($form_triggered) {
print "<script language=\"javascript\">alert('Form Triggered')</script>";
}
else
{
print "<script language=\"javascript\">alert('Form NOT Triggered')</script>";
}
?>
<br />
<!-- [snip the table/s to display the results] -->
<br />
<!-- add the 'standard' BOTTOM logos, navigation bar, etc-->
<?php
include("standard_format_items/bottom_navigation_bar.php");
?>
</body>
</html>
[/HTML]
--------------------------------------------
With the div populated by AJAX as follows, in hydraulic_test_pulldowns_select.js:
Expand|Select|Wrap|Line Numbers
- //...
- document.getElementById('query_execute_icon').innerHTML = xmlHttp.responseText;
- //...
PHP for the innerResponse text:
[PHP]
//HYDRAULIC TESTING DATA QUERY - ALLOW/'ACTIVATE' QUERY EXECUTE ICON (sic)
//the 'point' of the page, a simple change of the query's submit buttons/icon parameters
$output = "<input type=\"image\" value=\"search\" name=\"query_with_parameters\" src=\"images/icon_search2.gif\" alt=\"Submit\" title=\"Return Data, from/with selected parameter/s selection\" class=\"toggleopacity\" />";
$output .= "<br />";
$output .= "<div style=\"font-style:italic; font-size:7pt\"><br />Submit Query</div>";
//the 'return'
print $output;
[/PHP]