View Full Version : Firefox Bug


Douglas
12-07-2005, 11:43 PM
This script i made doesnt work in firefox but does in IE, when I click on the button, it doesnt do anything:


function launch(url, method) {
document.forms[0].url.value=url;
document.forms[0].method.value=method;
open();
}

function addInfo(real_pword, pword, new_pword, new_pword_c, public, profile_text, public_e, user, code) {
if (new_pword == "") {
if (pword != "") {
launch('process_wizard.php?step=2&pword='+pword+'&new_pword=oldpword&public='+public+'&profile_text='+profile_text+'&public_e='+public_e+'&user='+user+'&code='+code+'','get');
}
else {
alert("Something was left blank!");
}
}
else {
if (new_pword == new_pword_c) {
if (pword == real_pword) {
launch('process_wizard.php?step=2&pword='+pword+'&new_pword='+new_pword+'&public='+public+'&profile_text='+profile_text+'&public_e='+public_e+'&user='+user+'&code='+code+'','get');
}
else {
alert("Wrong password. Please try again.");
}
}
else {
alert("Those two passwords don't match!");
}
}
}


This uses AJAX, but it is mainly JavaScript, here is the button code:


<input type="button" onclick="javascript:addInfo('<? echo $real_password; ?>',''+document.main_form.pword.value+'',''+document .main_form.new_pword.value+'',''+document.main_for m.new_pword_c.value+'',''+document.main_form.publi c.value+'',''+document.main_form.profile_text.valu e+'',''+document.main_form.public_e.value+'','<? echo $user; ?>','<? echo $real_code; ?>');" value="Next" />&nbsp;<input type="button" onclick="javascript:launch('process_wizard.php?skip=yes&user=<? echo $user; ?>','get');" value="Skip Wizard" />

Neither of them work.

harmor
12-08-2005, 01:20 AM
I'm not that good with ajax but try adding this at the top

function makeObject(){
var x;
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer"){
x = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
x = new XMLHttpRequest();
}
return x;
}

var request = makeObject();

Douglas
12-08-2005, 05:37 PM
Oh, I have that in another file, I'm sure that works, because I use it on my site and on the site I'm working on.