[TYPO3-shop] Problems when form is submitted by javascript
Joachim Rosskopf
rosskopf at progroup-inc.com
Tue Sep 12 13:20:19 CEST 2006
Hello,
I´m no Typo3/PHP expert, so I tried to do the following to add a
checkbox in the ###BASKET_PAYMENT_TEMPLATE### part.
<snip>
<tr>
<td colspan=6>
<input type="checkbox" id="agbSelected"><font size="2">
<b> AGB/ Rückgabebelehrung akzeptieren</b></font>
</td>
</tr>
<tr>
<td colspan=6><img src="clear.gif" width=1 height=10></td>
</tr>
<tr>
<td colspan=6><img src="clear.gif" width=1 height=10></td>
</tr>
</TABLE>
<script tpye="text/javascript">
function checkAgb() {
var box = document.getElementById("agbSelected");
if (box == null) {
alert("Can´t find checkbox!");
}
if (box.checked) {
document.forms[0].action='###FORM_URL_THANKS###';
document.forms[0].target='###FORM_URL_TARGET###';
document.forms[0].submit();
} else {
alert("Achtung: Bevor die Bestellung ...");
}
}
</script>
<br>
<FORM method="post" action="###FORM_URL###">
<input type="Submit" name="products_update" value="Zurück zum
Warenkorb"> <input type="Button" name="products_finalize"
value="Bestellvorgang abschliessen!" onClick="checkAgb();">
</FORM>
</snip>
The code does the right, as far as checking if the checkbox is selected.
But when the form is selected I got redirected to the Basket and not
to the Finalize page.
But where is the difference form my javascript to the Orginal one?
<snip>
<input type="Submit" name="products_update" value="Zurück zum
Warenkorb"> <input type="Submit" name="products_finalize"
value="Bestellvorgang abschliessen!"
onClick="document.forms[0].action='###FORM_URL_THANKS###';
document.forms[0].target='###FORM_URL_TARGET###';">
</snip>
Thank you in andvance.
Regards
---
Joachim
More information about the TYPO3-project-tt-products
mailing list