• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Auto click a form button when linked from differen

Auto click a form button when linked from differen 8 years 2 months ago #36530

  • info6586
  • info6586's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
I have a quotation multipage form, on the first page it asks few questions and when the user clicks on "Get a Quote" button it shows them the quote on the second page.

My second form contains the questions only and I added it to the homepage (quick form) and when user submit that, it redirects them to the quotation form and auto populate the fields.

I need to show the user the quote (second page) if they access the form trough homepage form.

the button ID: "getaquoteNext"

and this is the function it trigger when clicked:
onclick="spanValue();"


The support advised me I can do it this way:

a script within "Scripts Called On Form Display" that performs a parameter check so you know when users come from your homepage form:
www.rsjoomla.com/support/documentation/r...ted/php-scripts.html

when this happens you can try inserting some JavaScript within the form layout (same scripting area as pointed out above - though you'll have to include it as string since you can only use PHP).
the JavaScript can then either click the button when the page loads or call the functions your button uses (basically emulates the click).

I found this JS code that clicks on the button.
<script type="text/javascript">
function clickButton() {
    $("#getaquoteNext").click(); 
});
</script>


and I use this script (Script called after form has been processed) in home page form to submit the data to quotation form
$url = '/book-a-service.html';
$url .= '?form[postcode1]='.$_POST['form']['postcode'].'&form[Service]='.$_POST['form']['serviceType'][0];
$url .= '&form[make][]='.$_POST['form']['brands'][0];
$url .= '&form[appliance][]='.$_POST['form']['appliances'][0];
header('Location: '.$url);
die();

Could anyone please help me with this. thanks in advance.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!