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

innerHTML, AJAX and Firefox

P: 1
I have an application with a form that has two parts : A & B.
A should be a static form while B shoudl be dynamically loaded via AJAX/PHP.

Using a select box on part A, the onchange event calls an AJAX PHP script that generates PART B (in HTML)
On positive AJAX reply, Part B's HTML is replaced by the returned HTML (using innerHTML)
Works perfect on IE, but not on FF.

On FF, the new form is properly displayed, but when trying to submit the form, the input data is not recognized.

I know that IE supports innerHTML with no problem, while FF has some issues.
However, I would like to get Part B from PHP using AJAX as maintenance will be easier as Part B might have many versions.

Any idea will be greatly appreciated.

Thank you

Apr 30 '07 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 15k+
P: 16,027
Welcome to TSDN.

Can you post your code.
May 1 '07 #2

P: 1
i am also using the ajax/php/innerhtml

the ajax file i am using is,

// JavaScript Document
var isMinNS4 = (document.layers) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;

function get(flag)

var urlall="user/register/myrole";"GET",urlall, true);
http.onreadystatechange = handleHttpResponse;
function handleHttpResponse()
if (http.readyState == 4)
results = http.responseText;
document.getElementById("mydiv").innerHTML = "";
document.getElementById("mydiv").innerHTML = results;

function getHTTPObject()
var xmlhttp;
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
return xmlhttp;

var http = getHTTPObject(); // We create the HTTP Object


here also i have issue of FF., it works fine in IE but not working in FF, in FF it will taking whole layout again.

please rovide the help, if possible.

thank you
May 22 '07 #3

Expert Mod 15k+
P: 16,027
Try using a better version provided in the AJAX tutorials in the Offsite Links thread at the top of this forum.
May 22 '07 #4

Expert 5K+
P: 7,435
innerHTML is not part of any standard but this may help.
May 22 '07 #5

Post your reply

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