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_ex ists('_submit_c heck', $_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.dt d">
<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("standa rd_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="JavaS cript" src="AJAX/hydraulic_test_ query/hydraulic_test_ pulldowns_selec t.js"></script>
</head>
<body bgcolor="#fffff f" 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("standa rd_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_err or($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.lo cation_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.loc ation_id = d_bore.location _id) AND (d_bore.locatio n_id = d_location.loca tion_id)) ON (d_hydraulictes t.bore_id_test = d_bore.bore_id) AND (d_hydraulictes t.bore_id_test = d_bore.bore_id)
GROUP BY d_site.site_id, d_location.loca tion_id
ORDER BY d_site.site_id, d_location.loca tion_id";
$query_result=p g_query($db_con nect, $SQL_Query);
$row_counter_la bel=0;
while($row_data =pg_fetch_array ($query_result) ) {
$row_counter_la bel += 1;
$ary_query_resu lt_SUM_site_plu s_loc[$row_counter_la bel] = $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_sele ct">
<input type="hidden" name="_submit_c heck" value="1" />
<tr class="header_s elect" style="font-weight:bold" valign="middle" >
<td align="center">
<div id="site_locati on_title">
<div style="color:re d">
Select<br />SITE / LOCATION
</div>
</div>
</td>
<td align="center">
<div id="test_date_s tart_title">
<div style="color:gr ay">
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_g et_test_dates(t his.value)">
<?php
foreach($ary_qu ery_result_SUM_ site_plus_loc as $option_string) {
print "<option value=\"$option _string\">$opti on_string</option>";
}
?>
</select>
</td>
<td align="center">
<div id="test_dates" >
<select size="4" style="color:gr ay; font-variant:italic" >
<option>{sele ct the site / location}</option>
</select>
</div>
</td>
<td align="center">
<div id="query_execu te_icon">
<img src="images/icon_search2.gi f" alt="INACTIVE: Submit Query" title="Select EVERY PARAMETER/s to Allow Query Execution" style="filter:a lpha(opacity=35 );-moz-opacity:0.35;op acity: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_ex ists('_submit_c heck', $_POST))
{//USER SELECTION HAS BEEN MADE
// [snipped things to do]
}
//DELETE ME - 'TEST CODE'
if($form_trigge red) {
print "<script language=\"java script\">alert( 'Form Triggered')</script>";
}
else
{
print "<script language=\"java script\">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("standa rd_format_items/bottom_navigati on_bar.php");
?>
</body>
</html>
[/HTML]
--------------------------------------------
With the div populated by AJAX as follows, in hydraulic_test_ pulldowns_selec t.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_wi th_parameters\" src=\"images/icon_search2.gi f\" alt=\"Submit\" title=\"Return Data, from/with selected parameter/s selection\" class=\"toggleo pacity\" />";
$output .= "<br />";
$output .= "<div style=\"font-style:italic; font-size:7pt\"><br />Submit Query</div>";
//the 'return'
print $output;
[/PHP]