Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.form2.submit() problems :/ 1

Status
Not open for further replies.

youradds

Programmer
Joined
Jun 27, 2001
Messages
817
Location
GB
Hi,

Got a bit of a weird issue here :/

I'm using:

<a class="button" href="#" onclick="document.form2.submit()">Proceed</a>

..which gives the error;

Error: document.form2 has no properties
Source File: ...
Line: 1

.. but the <form> is set as;

<form class=frm action=" method="post" name="form2">

However, this works fine for a 5 other different forms!

<form class=frm action=" method="post" name="form1">

..works with;

<a class="button" href="#" onclick="document.form1.submit()">Proceed</a>

..and;

<form class=frm action=" method="post" name="form3">

..works with;

<a class="button" href="#" onclick="document.form3.submit()">Proceed</a>

..etc.

Can anyone see why there would be an issue with using "form2" - or is it something more subtle?

TIA!

Andy
 
- Does form2 have an element named "submit" in it?

- Do you have more than one element named "form2"?

- Do you have any elements with an id of "form2"?

- Does it error just in one browser?

- Have you tried other browsers?

- Can you post more source, or a URL?

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
And of course:

- Do you ever vote posts helpful? I've just looked at your posting / voting stats - you've asked over 110 questions, and not marked even one of them as being helpful.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi,

Thanks for your reply. Here is the main code (I've removed all non-needed stuff, i.e the header, title, CSS file etc, thus the crappy look =)).

Code:
<h2>Automatic Renewal</h2>
<p>If you want to automatically renew your account, and lock into today's prices for ever, please select one of these options. Your account will be automatically extended and your card billed until you cancel. You can cancel any time, by simply pressing a button on your Member's Home page. The following subscriptions will be charged to your debit or credit card (in £GBP, $USD or Euros).</p>
<table class="content_table">
<tr class="thead">
<th width="110px" class="empty">&nbsp;</th>
<th><span>Initial Payment</span></th>
<th><span>Subsequent Payment</span></th>

<th><span>Equivalent Daily Rate</span></th>
<th class="empty">&nbsp;</th>
</tr>
<form class=frm action="[URL unfurl="true"]https://select.worldpay.com/wcc/purchase"[/URL] method="post" name="form1">
<tr class="grey">
<th>Monthly</th>
<td>&pound;9.99</td>
<td>&pound;4.99</td>
<td>33p (16p/thereafter)</td>
<td width="68" valign="middle">
<input type="hidden" name="signatureFields" value="amount:currency:M_lngth:cartId" />
<input type="hidden" name="signature" value="daecb211c01aee975f2f2e77fda8981b" />

<input type="hidden" name="cartId" value="cwi_foobdfgdfdf" />
<input type="hidden" name="country" value="GB" />
<input type="hidden" name="M_action" value="auth" />
<input type="hidden" name="M_Username=" value="foobdfgdfdf" />
<input type="hidden" name="M_Password" value="foobdfgdfdf" />
<input type="hidden" name="M_aff" value="nocookie" />
<input type="hidden" name="M_lngth" value="32" />
<input type="hidden" name="M_renew" value="yes" />
<input type="hidden" name="M_AmountGBP" value="9.99" />
<input type="hidden" name="email" value="andfoobdfgdfdf@ultranerds.com" />
<input type="hidden" name="amount" value="9.99" />
<input type="hidden" name="currency" value="GBP" />
<input type="hidden" name="desc" value="1 month subscription to Site.com (Automatic Renewal) - new account" />
<input type="hidden" name="futurePayType" value="regular" />
<input type="hidden" name="startDelayUnit" value="3" />
<input type="hidden" name="startDelayMult" value="1" />

<input type="hidden" name="intervalUnit" value="3" />
<input type="hidden" name="intervalMult" value="1" />
<input type="hidden" name="normalAmount" value="4.99" />
<input type="hidden" name="M_PaidSignUp" value="1" />
<input type="hidden" name="M_DateOfBirth" value="1996-3-3" />
<a class="button" href="#" onclick="document.form1.submit()">Proceed</a>
</td>
</tr>
<form class=frm action="[URL unfurl="true"]https://select.worldpay.com/wcc/purchase"[/URL] method="post" name="form2">
<tr>
<th>Six Monthly</th>
<td>&pound;14.99</td>
<td>&pound;14.99</td>

<td>8p</td>
<td valign="middle">
<input type="hidden" name="signatureFields" value="amount:currency:M_lngth:cartId" />
<input type="hidden" name="signature" value="31fe949d16a5fe77c2597bdb75fab10d" />
<input type="hidden" name="cartId" value="cwi_foobdfgdfdf" />
<input type="hidden" name="M_action" value="auth" />
<input type="hidden" name="M_Username=" value="foobdfgdfdf" />
<input type="hidden" name="M_Password" value="foobdfgdfdf" />
<input type="hidden" name="M_aff" value="nocookie" />
<input type="hidden" name="M_lngth" value="188" />
<input type="hidden" name="M_renew" value="yes" />
<input type="hidden" name="M_AmountGBP" value="14.99" />
<input type="hidden" name="email" value="andfoobdfgdfdf@ultranerds.com" />
<input type="hidden" name="amount" value="14.99" />
<input type="hidden" name="currency" value="GBP" />

<input type="hidden" name="country" value="GB" />
<input type="hidden" name="desc" value="6 months subscription to Site.com (Automatic Renewal) - new account" />
<input type="hidden" name="futurePayType" value="regular" />
<input type="hidden" name="startDelayUnit" value="3" />
<input type="hidden" name="startDelayMult" value="6" />
<input type="hidden" name="intervalUnit" value="3" />
<input type="hidden" name="intervalMult" value="6" />
<input type="hidden" name="option" value="0" />
<input type="hidden" name="normalAmount" value="14.99" />
<input type="hidden" name="M_PaidSignUp" value="1" />
<input type="hidden" name="M_DateOfBirth" value="1996-3-3" />
<a class="button" href="#" onclick="document.form2.submit()">Proceed</a>
</td>
</tr>
</form>
<form class=frm action="[URL unfurl="true"]https://select.worldpay.com/wcc/purchase"[/URL] method="post" name="form3">

<tr class="grey">
<th>Annual</th>
<td>&pound;21.99</td>
<td>&pound;21.99</td>
<td>6p</td>
<td valign="middle">
<input type="hidden" name="signatureFields" value="amount:currency:M_lngth:cartId" />
<input type="hidden" name="signature" value="109bc9490ed932dec5a16193cc01a57f" />
<input type="hidden" name="cartId" value="cwi_foobdfgdfdf" />
<input type="hidden" name="M_action" value="auth" />
<input type="hidden" name="M_renew" value="yes" />
<input type="hidden" name="M_Username=" value="foobdfgdfdf" />

<input type="hidden" name="M_Password" value="foobdfgdfdf" />
<input type="hidden" name="M_aff" value="nocookie" />
<input type="hidden" name="M_lngth" value="366" />
<input type="hidden" name="M_AmountGBP" value="21.99" />
<input type="hidden" name="email" value="andfoobdfgdfdf@ultranerds.com" />
<input type="hidden" name="amount" value="21.99" />
<input type="hidden" name="currency" value="GBP" />
<input type="hidden" name="country" value="GB" />
<input type="hidden" name="desc" value="1 Year subscription to Site.com (Automatic Renewal)  - new account" />
<input type="hidden" name="futurePayType" value="regular" />
<input type="hidden" name="startDelayUnit" value="3" />
<input type="hidden" name="startDelayMult" value="12" />
<input type="hidden" name="intervalUnit" value="3" />
<input type="hidden" name="intervalMult" value="12" />
<input type="hidden" name="option" value="0" />
<input type="hidden" name="normalAmount" value="21.99" />
<input type="hidden" name="M_PaidSignUp" value="1" />

<input type="hidden" name="M_DateOfBirth" value="1996-3-3" />
<a class="button" href="#" onclick="document.form3.submit()">Proceed</a>
</td>
</tr>
</form>
</table>
</div>
<!--RAGTREIUBAEGVBAREUBGVAEWRVBRAf-->
<div id="content">
<h2>Subscription for Uploading Essays</h2>
<p>You can also <a href="[URL unfurl="true"]http://www.courseworkinfotest.com/cgi-bin/e/page.cgi?p=signup2;Username=foobdfgdfdf;Email=andfoobdfgdfdf@ultranerds.com;Password=foobdfgdfdf;DOB_Year=1996;DOB_Month=3;DOB_Day=3;exchange=1">subscribe[/URL] for free</a> by uploading 3 or more of your own essays or coursework documents. Each document will earn you 5 days access. </p>

<br>
<h2>One-Off Payments</h2>
<p>If you do not want to sign up for a recurring subscription then you can take advantage of the following one-off rates. Please note that these one-off rates can change at any time. In addition to debit or credit card (in £GBP, $USD or Euros), these one-off fees can also be paid by <a href="[URL unfurl="true"]http://www.courseworkinfotest.com/cgi-bin/e/page.cgi?page=cheque;Username=foobdfgdfdf;Email=andfoobdfgdfdf@ultranerds.com;Password=foobdfgdfdf">cheque</a>.</p>[/URL]
<table class="content_table">
<tr class="thead">
<th width="110px" class="empty">&nbsp;</th>
<th><span>Initial Payment</span></th>
<th><span>Equivalent Daily Rate</span></th>
<th class="empty">&nbsp;</th>
</tr>
<form class=frm action="[URL unfurl="true"]https://select.worldpay.com/wcc/purchase"[/URL] method="post" name="form4">

<tr class="grey">
<th>Monthly</th>
<td>&pound;9.99</td>
<td>33p</td>
<td valign="middle">
<input type="hidden" name="signatureFields" value="amount:currency:M_lngth:cartId" />
<input type="hidden" name="signature" value="daecb211c01aee975f2f2e77fda8981b" />
<input type="hidden" name="cartId" value="cwi_foobdfgdfdf" />
<input type="hidden" name="M_action" value="auth" />
<input type="hidden" name="M_Username=" value="foobdfgdfdf" />
<input type="hidden" name="M_Password" value="foobdfgdfdf" />
<input type="hidden" name="M_aff" value="nocookie" />
<input type="hidden" name="M_lngth" value="32" />

<input type="hidden" name="country" value="GB" />
<input type="hidden" name="email" value="andfoobdfgdfdf@ultranerds.com" />
<input type="hidden" name="M_AmountGBP" value="9.99" />
<input type="hidden" name="amount" value="9.99" />
<input type="hidden" name="currency" value="GBP" />
<input type="hidden" name="desc" value="1 month access to Site.com  - new account" />
<input type="hidden" name="M_PaidSignUp" value="1" />
<input type="hidden" name="M_DateOfBirth" value="1996-3-3" />
<a class="button" href="#" onclick="document.form4.submit()">Proceed</a>
</td>
</tr>
</form>
<form class=frm action="[URL unfurl="true"]https://select.worldpay.com/wcc/purchase"[/URL] method="post" name="form5">
<tr>
<th>Six Monthly</th>

<td>&pound;14.99</td>
<td>8p</td>
<td valign="middle">
<input type="hidden" name=signatureFields value="amount:currency:M_lngth:cartId" />
<input type="hidden" name=signature value="31fe949d16a5fe77c2597bdb75fab10d" />
<input type="hidden" name="cartId" value="cwi_foobdfgdfdf" />
<input type="hidden" name="M_action" value="auth" />
<input type="hidden" name="country" value="GB" />
<input type="hidden" name="M_Username=" value="foobdfgdfdf" />
<input type="hidden" name="M_Password" value="foobdfgdfdf" />
<input type="hidden" name="M_aff" value="nocookie" />
<input type="hidden" name="M_lngth" value="188" />
<input type="hidden" name="email" value="andfoobdfgdfdf@ultranerds.com" />
<input type="hidden" name="amount" value="14.99" />

<input type="hidden" name="M_AmountGBP" value="14.99" />
<input type="hidden" name="currency" value="GBP" />
<input type="hidden" name="desc" value="6 months access to Site.com  - new account" />
<input type="hidden" name="M_DateOfBirth" value="1996-3-3" />
<input type="hidden" name="M_PaidSignUp" value="1" />
<a class="button" href="#" onclick="document.form5.submit()">Proceed</a>
</td>
</tr>
</form>
<tr class="grey">
<th>Annual</th>
<td>&pound;21.99</td>
<td>6p</td>

<form class=frm action="[URL unfurl="true"]https://select.worldpay.com/wcc/purchase"[/URL] method="post" name="form6">
<td valign="middle">
<input type="hidden" name="signatureFields" value="amount:currency:M_lngth:cartId" />
<input type="hidden" name="signature" value="109bc9490ed932dec5a16193cc01a57f" />
<input type="hidden" name="cartId" value="cwi_foobdfgdfdf" />
<input type="hidden" name="M_action" value="auth" />
<input type="hidden" name="country" value="GB" />
<input type="hidden" name="M_Username=" value="foobdfgdfdf" />
<input type="hidden" name="M_Password" value="foobdfgdfdf" />
<input type="hidden" name="M_aff" value="nocookie" />
<input type="hidden" name="M_lngth" value="366" />
<input type="hidden" name="email" value="andfoobdfgdfdf@ultranerds.com" />
<input type="hidden" name="amount" value="21.99" />
<input type="hidden" name="currency" value="GBP" />
<input type="hidden" name="desc" value="1 Year Access to Site.com  - new account" />
<input type="hidden" name="M_PaidSignUp" value="1" />

<input type="hidden" name="M_DateOfBirth" value="1996-3-3" />
<a class="button" href="#" onclick="document.form6.submit()">Proceed</a>
</td>
</tr>
</form>
</table>


- Do you ever vote posts helpful? I've just looked at your posting / voting stats - you've asked over 110 questions, and not marked even one of them as being helpful.

Erm, may sound silly, but how do I do that? :P I'd be happy too - as this sites has been a great resource for helping with my more annoying issues (most of the time, silly - but most definatly annoying <G>)

TIA!

Andy
 
Your problem is that you are not closing form1 anywhere. While I couldn't say for sure, it's a good bet that validating your source would have found that.

To vote posts helpful, you use the "Thank <username> for this valuable post!" link at the bottom left of every post in a thread.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
It sure did - thanks :)) Just about to rate your reply.

Thanks again!

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top