View Full Version : IE7 weird AJAX element update problem

01-19-2009, 01:44 PM
Hi All,

First off all I'm not a complete noob but I am also not an expert.

I'll try to explain. I have a very simple update form which gets it value from an mysql query WHERE id = URL GET VALUE

In the form I have an input field containing a random string only in letters from a to z without spaces. When you want to change the string, a function ProMargin() is called onBlur. I use the following function icw the prototype library

function ProMargin(){
var params = Form.serialize($('project'));
new Ajax.Updater('promarge', 'aj.projectmarge.php', {method: 'get', asynchronous:true, parameters:params, onCreate: function(){ Element.show('spinner')}, onFailure: function(){ Element.hide('spinner')}});

This simple function calls aj.projectmarge.php . In this php file the string is checked with the database to see if the string exists yes or no and echoes back OK or NOT OK in the div with ID promarge. That's all very simple.

The problem:

When I have http://[url]/form.php?id=1, the form gets data from the database with ID 1 but then the function does not work. It only shows the spinner (onCreate) but nothing else. When I go to the form http://[url]/form.php without the get variable (so no data from database in form) the function works. I can fill in a string and function checks and echoes ok or not ok. Do I retrieve data with get variable, then it does not work.

In all other browser like FF, Chrome and Safari it works as supposed to, with get variable, without any problems.

Normally the div 'promarge' is empty and will only contain a value after the update. But to check i have put in a standard text to see if anything happens. In all browsers except IE7 the text is replaced with OK or NOT OK. In IE7 it becomes blank, and showing the spinner.

I am getting crazy, especiialy becuase this function/form is soooo basic. I tried it on various machines, vista and XP. Still no luck. Can the data collection from the database with the get variable cause this problem? It seems so strange.

thanks for the help.