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" /> <input type="button" onclick="javascript:launch('process_wizard.php?skip=yes&user=<? echo $user; ?>','get');" value="Skip Wizard" />
Neither of them work.
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" /> <input type="button" onclick="javascript:launch('process_wizard.php?skip=yes&user=<? echo $user; ?>','get');" value="Skip Wizard" />
Neither of them work.