I am having a very weird issue here, a simple form submit not working. Trying for several hours now ... must be something stupid ... help appreciated.
First, the html -
Then - the javascript.
It seems to be getting executed in case I change the line from document.getEle mentById(formId ).action=url; to alert(document. getElementById( formId).action) ;
I can see that I am getting the right action in the alert. However, as it stands now, it's simply not working. :(:(:(
What's happening when I tell that it's not working? Well, problem is nothing really is working. No error icon in IE, no error in FF error console, nothing moves as I click on either of these buttons !
Joining the two functions to one doesn't change things either ...
Thanks for having a look.
Regards.
First, the html -
Code:
<form id="formFinale" method="post" action="noscript.php" enctype="application/x-www-form-urlencoded">
<div class="myStyle">Votre nom ? <input type="text" size="36" name="ouchocolat" id="ouchocolat" value="" /></div>
<div class="myStyle">J’ai lu et je suis d’accord avec les <a href="conditions.html" onclick="this.target='_blank'">conditions générales de vente</a> : <input type="checkbox" name="agree" id="agree" /></div>
<div class="rightContent right">
<div class="center"><input type="button" class="button" value="Paiement en ligne" onclick="ifagree('agree','formFinale','getForm.php?ph=3&action=bank');" /></div>
</div>
<div class="r">
<div class="center"><input type="button" class="button" value="Paiement par cheque" onclick="ifagree('agree','formFinale','getForm.php?ph=3&action=check');" /></div>
</div>
<div class="clearer"></div>
</form>
Code:
function multiSubmit(formId,url) {
document.getElementById(formId).action=url;
}
function ifagree(id,formId,url) {
if (document.getElementById(id).checked == false) {
alert('Veuillez accepter les condition général de vente.');
return false;
} else {
if(url) {
return multiSubmit(formId,url);
} else {
return true;
}
}
}
I can see that I am getting the right action in the alert. However, as it stands now, it's simply not working. :(:(:(
What's happening when I tell that it's not working? Well, problem is nothing really is working. No error icon in IE, no error in FF error console, nothing moves as I click on either of these buttons !
Joining the two functions to one doesn't change things either ...
Code:
function ifagree(id,formId,url) {
if (document.getElementById(id).checked == false) {
alert('Veuillez accepter les condition général de vente.');
return false;
} else {
if(url) {
document.getElementById(formId).action=url;
} else {
return true;
}
}
}
Regards.
Comment