Sorry if this has appeared elsewhere in the group. Im not sure if it
posted the first two times!!!

I have a problem in a pretty complex app I'm writing. I load a page,
which populates some inputs with values picked up from a mySQL
database, like so:

(URL eg /projectDetails.php?projectId=12345)

<input type="text" id="projectCustomerName" name="projectCustomerName"
value="<?php print $projectCustomerName; ?>">

Not shown above, is that in the onKeyUp() event of that text box, I
call a function which displays a dynamic list of potential customers
matching the text in the box. This works fine. In the OnClick() event
of each item in the drop down box (a div with a table inside) I call
another function which tries to insert values for this item on to the
page, like so:

(HTML generated from PHP)
<td onClick="insertCustomerDetails('test','1')">test</td>

<script type="text/javascript">
function insertCustomerDetails(cName, cId) {
    $('#projectCustomerName').val(cName);
    $('#projectCustomerId').val(cId);
}
</script>

This also works well.

However, without even saving the newly selected items, if I refresh
the page using the Refresh button in FF3 (on Linux) the new values are
retained - even though the PHP page should be picking them up from the
MySQL database when it loads.

To get the values to clear I have to either adjust the URL or close
and re-open the page.

I also have added the following to my header to make sure it is not
caching...

<?
//Set no caching
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

Any ideas? Its driving me mad.

Sam

Reply via email to