hi
i have a js problem (below) if anyone can help, but i would like to know
of some good javascript forums. ive looked around but if anyone can
recommend any then that would be great
jamo
1.
hi guys,
i have a page which a user will see when they have placed an order. The
user is then required to submit paymant for each amount seperatly. the
user is presented with the following forms, which open a pop up for them
to pay (thorugh worldpay,paypal etc) and the form variables are passed
with a post.
<form name="payment1" target="vendor" action="someaction" method="post">
<input type="hidden" name="item_number" value="BGS_1_fun007_2">
<input type="hidden" name="amount" value="5.50">
<input id="payment1submit" type="submit" name="submit" >
</form>
<form name="payment2" target="vendor" action="someaction" method="post">
<input type="hidden" name="item_number" value="BGS_2_fun007_2">
<input type="hidden" name="amount" value="5.50">
<input id="payment2submit" type="submit" name="submit" >
</form>
<form name="payment3" target="vendor" action="someaction" method="post">
<input type="hidden" name="item_number" value="BGS_3_fun007_2">
<input type="hidden" name="amount" value="5.50">
<input id="payment3submit" type="submit" name="submit" >
</form>
so basically, when the user clicks on the payment1 submit button, it needs
to submit its form (in a new window), and then disable itself so that the
user cant submit payment for the same item by mistake. they then clikc on
payment2 submit which does the same and so on, until all forms have been
posted. Each form has a unique name, as does each submit button. I have
written scripts which disable form elements based on the onclick event,
but using this it only disables the form submit button, and doesnt allow
the form to post first, then disable itself.
cheers in advance.
jamo
2.
<SCRIPT Language="JavaScript">
function submitTheFormDagnammit(formname) {
//loop through form elements to look for the submit type and set it to
disabled
for (i=1; i<document.forms[formname].elements.length; i++) {
if (document.forms[formname].elements[i].type == 'submit') {
document.forms[formname].elements[i].disabled = true;
}
}
//submit the form
document.forms[formname].submit();
//assign submitTheFormDagnammit to the blank function in case the form
element is not disabled so nothing happens when it is called again
submitTheFormDagnammit= blank;
return false;
}
function blank(formname) {
return false;
}
</SCRIPT>
then this onclick event in the forms.
onclick="return submitTheFormDagnammit(this.form);"
I think that my theory is correct, but my syntax may not be, or isnt!
i keep getting the error
document.forms[....].elements is null or not an object
can anyone see my error
mucho appreciatio
jamo
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/