473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

IE7 form submit problem

I have a problem with submitting a form to a PHP page through a
dynamically created IFRAME in IE7. This code works fine in Firefox.
However, IE7 submits an empty form--the correct PHP page is called, but
no form variables are passed to the page.

Here's the client-side code:

//Create or reuse an IFRAME to submit data to a specified page.
//commandToken: A string that tells the page what to do.
//data: Data that the page will work with.
//callbackFunctionName: Name of javascript function to call when the
page returns.
//userID: ID of user.
//url: Page to which form will be submitted.
//iFrame: Name or reference of IFRAME through which the form data will
be submitted.
GenericWindow.prototype.executeServerRequest2 = function(commandToken,
data, callbackFunctionName, userID, url, iFrame)
{
var theIFRAME = null;

//If the specified IFRAME is a string then create the new IFRAME
element.
if(iFrame.length)
{
theIFRAME = this.createDataExchangeIFrame2(iFrame);
}
else
{
theIFRAME = iFrame;
}

if(callbackFunctionName != null)
{
if(!url)
{
url = serverURL;
}
else
{
url = serverURLBase + url;
}

var htmlString = "<html><body onLoad=''>";
htmlString += '<form action="' + url + '" id="submitForm"
name="submitForm" method="post">';
htmlString +='<input type="hidden" id="USERID" name="USERID" value="'
+ userID + '">';
htmlString +='<input type="hidden" id="DATA" name="DATA" value="' +
data + '">';
htmlString +='<input type="hidden" id="COMMAND" name="COMMAND"
value="' + commandToken + '">';
htmlString +='<input type="hidden" id="CALLBACK" name="CALLBACK"
value="window.parent.bbsRenderer.getWindow(&quot;' + this._windowName +
'&quot;).' + callbackFunctionName + '()">';
htmlString +='<input type="hidden" id="AUTHENTICATION_TOKEN"
name="AUTHENTICATION_TOKEN" value="' +
document.getElementById("AUTHORIZATION_TOKEN").val ue + '">';
htmlString +='</form>';
htmlString +='</body></html>';

this.logCommand(commandToken, htmlString);

if(theIFRAME.contentDocument)
{
//For Mozilla and similar browsers.
theIFRAME.contentDocument.write(htmlString);
theIFRAME.contentDocument.getElementById("submitFo rm").submit();
}
else if(theIFRAME.document)
{
//For IE and similar browsers.
document.frames[theIFRAME.id].document.write(htmlString);
document.frames[theIFRAME.id].document.forms[0].submit();
}
}

return theIFRAME;
}

/*Creates the IFRAME used to communicate between the window and the
server.
If the IFRAME already exists, then it will be reused.*/
GenericWindow.prototype.createDataExchangeIFrame2 = function(iFrameID)
{
var iFrame = document.getElementById(iFrameID);
if(iFrame != null)
{
return iFrame;
}
else
{
iFrame = document.createElement("IFRAME");

if(iFrameID == null)
{
iFrame.id = this._windowName + "_DataExchangeIFrame_" +
this._dataExchangeIFrameList.length;
}
else
{
iFrame.id = iFrameID;
}

this._windowFrame.appendChild(iFrame);
this._dataExchangeIFrameList[this._dataExchangeIFrameList.length] =
iFrame;
iFrame.src = "blank.html";

return iFrame;
}
}
Here's the server-side code:
$userID = $_POST['USERID']; //Calling process's user ID. The value
must be numeric and not null.
$data = $_POST['DATA']; //Calling process's data.
$callback = $_POST['CALLBACK']; //Calling process's callback
information.
$commandToken = $_POST['COMMAND']; //Calling process's command token.
This value is required.
$authenticationToken = $_POST['AUTHENTICATION_TOKEN']; //Calling
process's authentication token, used to verify sessions.

Result of a call in Firefox (I used PHPINFO() to dump the request and
post variables):
_REQUEST["USERID"] null
_REQUEST["DATA"] <GET_ROOM_DESCRIPTION roomID=\'2\' userID=\'0\'/>
_REQUEST["COMMAND"] GET_ROOM_DESCRIPTION
_REQUEST["CALLBACK"] window.parent.bbsRenderer.getWindow(\"LoginWindow\ ").handleGetDataResponse()
_REQUEST["AUTHENTICATION_TOKEN"] no value
_POST["USERID"] null
_POST["DATA"] <GET_ROOM_DESCRIPTION roomID=\'2\' userID=\'0\'/>
_POST["COMMAND"] GET_ROOM_DESCRIPTION
_POST["CALLBACK"] window.parent.bbsRenderer.getWindow(\"LoginWindow\ ").handleGetDataResponse()
_POST["AUTHENTICATION_TOKEN"] no value

The same call with the same data values produces no request or post
variables from IE.

Any help would be appreciated!

Dec 30 '06 #1
1 10917
I rebooted the computer, and the problem seems to have gone away...

On Dec 29, 9:16 pm, "gzannd" <gza...@gmail.comwrote:
I have a problem with submitting a form to a PHP page through a
dynamically created IFRAME in IE7. This code works fine in Firefox.
However, IE7 submits an empty form--the correct PHP page is called, but
no form variables are passed to the page.

Here's the client-side code:

//Create or reuse an IFRAME to submit data to a specified page.
//commandToken: A string that tells the page what to do.
//data: Data that the page will work with.
//callbackFunctionName: Name of javascript function to call when the
page returns.
//userID: ID of user.
//url: Page to which form will be submitted.
//iFrame: Name or reference of IFRAME through which the form data will
be submitted.
GenericWindow.prototype.executeServerRequest2 = function(commandToken,
data, callbackFunctionName, userID, url, iFrame)
{
var theIFRAME = null;

//If the specified IFRAME is a string then create the new IFRAME
element.
if(iFrame.length)
{
theIFRAME = this.createDataExchangeIFrame2(iFrame);
}
else
{
theIFRAME = iFrame;
}

if(callbackFunctionName != null)
{
if(!url)
{
url = serverURL;
}
else
{
url = serverURLBase + url;
}

var htmlString = "<html><body onLoad=''>";
htmlString += '<form action="' + url + '" id="submitForm"
name="submitForm" method="post">';
htmlString +='<input type="hidden" id="USERID" name="USERID" value="'
+ userID + '">';
htmlString +='<input type="hidden" id="DATA" name="DATA" value="' +
data + '">';
htmlString +='<input type="hidden" id="COMMAND" name="COMMAND"
value="' + commandToken + '">';
htmlString +='<input type="hidden" id="CALLBACK" name="CALLBACK"
value="window.parent.bbsRenderer.getWindow(&quot;' + this._windowName +
'&quot;).' + callbackFunctionName + '()">';
htmlString +='<input type="hidden" id="AUTHENTICATION_TOKEN"
name="AUTHENTICATION_TOKEN" value="' +
document.getElementById("AUTHORIZATION_TOKEN").val ue + '">';
htmlString +='</form>';
htmlString +='</body></html>';

this.logCommand(commandToken, htmlString);

if(theIFRAME.contentDocument)
{
//For Mozilla and similar browsers.
theIFRAME.contentDocument.write(htmlString);
theIFRAME.contentDocument.getElementById("submitFo rm").submit();
}
else if(theIFRAME.document)
{
//For IE and similar browsers.
document.frames[theIFRAME.id].document.write(htmlString);
document.frames[theIFRAME.id].document.forms[0].submit();
}
}

return theIFRAME;

}/*Creates the IFRAME used to communicate between the window and the
server.
If the IFRAME already exists, then it will be reused.*/
GenericWindow.prototype.createDataExchangeIFrame2 = function(iFrameID)
{
var iFrame = document.getElementById(iFrameID);
if(iFrame != null)
{
return iFrame;
}
else
{
iFrame = document.createElement("IFRAME");

if(iFrameID == null)
{
iFrame.id = this._windowName + "_DataExchangeIFrame_" +
this._dataExchangeIFrameList.length;
}
else
{
iFrame.id = iFrameID;
}

this._windowFrame.appendChild(iFrame);
this._dataExchangeIFrameList[this._dataExchangeIFrameList.length] =
iFrame;
iFrame.src = "blank.html";

return iFrame;
}

}Here's the server-side code:
$userID = $_POST['USERID']; //Calling process's user ID. The value
must be numeric and not null.
$data = $_POST['DATA']; //Calling process's data.
$callback = $_POST['CALLBACK']; //Calling process's callback
information.
$commandToken = $_POST['COMMAND']; //Calling process's command token.
This value is required.
$authenticationToken = $_POST['AUTHENTICATION_TOKEN']; //Calling
process's authentication token, used to verify sessions.

Result of a call in Firefox (I used PHPINFO() to dump the request and
post variables):
_REQUEST["USERID"] null
_REQUEST["DATA"] <GET_ROOM_DESCRIPTION roomID=\'2\' userID=\'0\'/>
_REQUEST["COMMAND"] GET_ROOM_DESCRIPTION
_REQUEST["CALLBACK"] window.parent.bbsRenderer.getWindow(\"LoginWindow\ ").handleGetDataResponse()
_REQUEST["AUTHENTICATION_TOKEN"] no value
_POST["USERID"] null
_POST["DATA"] <GET_ROOM_DESCRIPTION roomID=\'2\' userID=\'0\'/>
_POST["COMMAND"] GET_ROOM_DESCRIPTION
_POST["CALLBACK"] window.parent.bbsRenderer.getWindow(\"LoginWindow\ ").handleGetDataResponse()
_POST["AUTHENTICATION_TOKEN"] no value

The same call with the same data values produces no request or post
variables from IE.

Any help would be appreciated!
Dec 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: T.E. | last post by:
Hi all, I'm a newbie in php. I encounter a problem with php form that has only one textfield. If I click on the submit button, the form works fine. However, when I press 'enter', the form...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
4
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
4
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.