• 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: Conditional Elements - Docs No Help

Conditional Elements - Docs No Help 14 years 2 months ago #9700

I've looked over the RSForm Pro documentation on showing hidden fields (www.rsjoomla.com/customer-support/docume...-or-hide-fields.html) but I am not familiar with PHP and this code by itself, does not work. I'm assuming there needs to be some input on my side, any help would be appreciated.

I have added (per the documentation) this script in the form layout:
<script type="text/javascript">
function displayField()
{
if(document.getElementsByName('form[Radio]')[0].checked)
document.getElementById('hide').style.display="none";

if(document.getElementsByName('form[Radio]')[1].checked)
document.getElementById('hide').style.display="";
}
</script>

I also added onclick="displayField();" to the Additional Attributes of the radio button that I wish to trigger the hidden fields.

Then I added the <tr id="hide" to the five conditions I wish to become visible upon selecting the radio button.

What am I missing? Do I need to input the field names of the hidden values I want to make visable? If so, where?
The administrator has disabled public write access.

Re:Conditional Elements - Docs No Help 14 years 2 months ago #9705

  • matt
  • matt's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 14
Make a new table (html) for all components you want to hide. Add the id="hide" to the new table instead of a row. This made it work for me. I guess you have checked your code so it is working.

Matt
The administrator has disabled public write access.

Re:Conditional Elements - Docs No Help 14 years 2 months ago #9706

Thanks Matt, I'll try that tomorrow. Did you use the script provided in the docs, and if so, was it ok on it's own or did you have to apply any changes to it?
The administrator has disabled public write access.

Re:Conditional Elements - Docs No Help 14 years 2 months ago #9707

  • matt
  • matt's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 14
I used the script from RSJoomla documentation.

Matt
The administrator has disabled public write access.

Re:Conditional Elements - Docs No Help 14 years 2 months ago #9711

Okay Matt. I tried separating the table and using the id=hide like so:

*Non-hidden elements above
</table>
<table id="hide">
*hidden elements below

Did not work. Is that the correct application of the "hide" attribute to the table or did I do it wrong?
The administrator has disabled public write access.

Re:Conditional Elements - Docs No Help 14 years 2 months ago #9717

OK, I'm close! I finally was able to get the fields to hide but my last problem: I don't want the fields to be displayed unless the radio is selected. Currently, the fields are displayed and when checked it hides. The script I used is below and {2nd Location} is the radio option that triggers the hide.

<script type="text/javascript">
function displayField()
{
if(document.getElementsByName('form[2nd Location]')[0].checked)
document.getElementById('hide').style.display="";

if(document.getElementsByName('form[2nd Location]')[1].checked)
document.getElementById('hide').style.display="none";
}
</script>
The administrator has disabled public write access.

Re:Conditional Elements - Docs No Help 14 years 2 months ago #9767

  • matt
  • matt's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 14
You have to use a different javascript in that case. Sorry but I am not good at javascripts, hopefully its someone else who can make a script for you.

Matt
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!