Form working on one page but not another

How to fix a form that works in one page type but not another after a Joomla upgrade.

Overview

The issue is caused by outdated JavaScript using the MooTools library, which is no longer the default after upgrading to Joomla 3.
Rewrite the JavaScript code using jQuery syntax to ensure compatibility with the updated Joomla framework.

Answered
Wa Warren.Kessler 11 Sep, 2015
I have a form that we have been using for years on our Joomla 2.5 site. After upgrading to Joomla 3.4 the form no longer works properly. The form is to order a book, and on submit, it sends an email to us then transfers the user to paypal to finish the transaction. After the Joomla update everything works but the transfer to paypal.

The code used to transfer to PayPal is put in a Show Thanks Message action

<script type='text/javascript'>
window.addEvent('domready', function() {
  $('form1').submit();
});
</script>

<form id="form1" action="https://payflowlink.paypal.com" method="post">
<INPUT type="hidden" name="DESCRIPTION" value="Book Order">
<INPUT type="hidden" name="LOGIN" value="ourlogin">
...


I have discovered that form works when is loaded in a YooTheme ZOO article, but does not work when loaded in a Joomla article. I am not sure why.
ca calculus00 11 Sep, 2015
Gr GreyHead 11 Sep, 2015
Answer
Hi Warren,

That JavaScript snippet looks as though it was written using the MooTools library which Joomla! used until Joomla! 3 when it switched to jQuery. I suggest that you try re-writing using jQuery syntax instead.

Bob
This topic is locked and no more replies can be posted.