By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,016 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,016 IT Pros & Developers. It's quick & easy.

Form will 'fire' only in IE??

scubak1w1
P: 53
Hello,

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 = "&beta;"; // 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
  1. //...
  2. document.getElementById('query_execute_icon').innerHTML = xmlHttp.responseText;
  3. //...
------
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]
Apr 1 '08 #1
Share this Question
Share on Google+
3 Replies


Atli
Expert 5K+
P: 5,058
Hi.

Been trying to understand the problem...

Basically, you have a form.
You don't want the submit button of this form to be enabled until the form has been filled out?

Once the form has been filled out, you enabled the submit button by calling a static text from a PHP document via an Ajax call... which replaces a <img> of the disabled button with a <input> tag that should be used to submit the form?

If this is true, the Ajax call is unnecessary. You could simply replace it with a Javascript function that exchanges the <img> for the <input>.

Or even better, you could simply have the <input> there disabled, and have the Javascript enable it, changing the style as well to make it visible.

Am I missing something?
Apr 2 '08 #2

scubak1w1
P: 53
nope... you have it right... :-)

On another form/page using essentially the same code (for the form at least), I sequentially populate about 12 different 'chained' <select>s from the PostgreSQL database using AJAX and based on the user's response... this '12-chain' (sic) works in IE and non-IE browsers... - this is then used to get 'live' all the data from the database based on these 12 parameters (analytical chemistry results...)

when I made this form, and the data it displays in tables below, for expediency and consistency I basically copied the '12-chain' form, adjusted it for this '2-chain'... (SQL strings, tabulated output, etc) - as mentioned, works in IE and not in non-IE browsers...

I used AJAX as I know little JS (yep, a relative newbie...) - and had mashed up (sic) this approach.... and it was working on the previous form as expected...

I would give you a link to the working '12-chain' form as it is 'live' - but it needs to be behind an https:// as it is sensitive client data :-(

Can I bother you to provide a couple of quick URLs of examples of your suggested approach? Or some key words I should Google?

Thank you in advance:
GREG...
Apr 2 '08 #3

scubak1w1
P: 53
P.S. is there a 'trick' to see what the code on a page looks like on the client side as AJAX adjusts it? That is, if you 'view source' in the browser you seem to see just the original page as 'sent' by the web server... it would be good to see if in fact the <input> tag is being updated "correctly" in non-IE browsers...
Apr 2 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.