• 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: button linked to conditional

button linked to conditional 11 years 2 weeks ago #27294

  • chris441
  • chris441's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
How can i get a conditional area to show when the customer clicks a button? I would like a book now button that when clicked it shows a form.
The administrator has disabled public write access.

button linked to conditional 11 years 2 weeks ago #27305

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
Here's how you can do this:

1) Add a "Button" type of field to your form. Make sure it's an usual button, not a "Submit" button, you can read more about this type of field here:

www.rsjoomla.com/support/documentation/v...icle/834-button.html

In the button's configuration, head to the "Attributes" tab and add:

onclick="showFields()";

in the "Additional Attributes" field.

2) Head to Components >> RSForm!Pro >> Manage Forms >> edit your form >> Properties >> Form Layout and set "Auto Generate Layout" to "No". After doing so, in the form's layout text area, enclose the fields that you wish to have displayed when clicking the button in a <div> container having the id "hidden_elements" and the CSS "display" property set to "none", as shown below:

<div id="hidden_elements" style="display:none">enclose the fields' entire containers here</div>

Something similar can be found here:

www.rsjoomla.com/support/documentation/v...roups-of-fields.html

3) Head to the "CSS and Javascript" tab and add the following code in the "Javascript" area:

<script>
function showFields()
{
document.getElementById('hidden_elements').style.display="inherit";
}
</script>

The code will change the <div>'s style from "display:none" to "display:inherit" when the button is clicked, thus making the fields visible.

PS: Make sure to first configure all of your form's fields before proceeding to step 2), as disabling the automatic generation of the form's layout will cause future changes to not get applied in the frontend result of the form.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 11 years 2 weeks ago by silviup.
The administrator has disabled public write access.

button linked to conditional 10 years 8 months ago #28463

  • chris441
  • chris441's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Perfect, Thank you very much.
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!