Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

Conditional Elements - Docs No Help

Welcome, Guest
Username Password: Remember me

Conditional Elements - Docs No Help
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Conditional Elements - Docs No Help

Conditional Elements - Docs No Help 1 year, 12 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?

Re:Conditional Elements - Docs No Help 1 year, 12 months ago #9705

  • matt
  • OFFLINE
  • Expert Boarder
  • Posts: 98
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

Re:Conditional Elements - Docs No Help 1 year, 12 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?

Re:Conditional Elements - Docs No Help 1 year, 12 months ago #9707

  • matt
  • OFFLINE
  • Expert Boarder
  • Posts: 98
I used the script from RSJoomla documentation.

Matt

Re:Conditional Elements - Docs No Help 1 year, 11 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?

Re:Conditional Elements - Docs No Help 1 year, 11 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>

Re:Conditional Elements - Docs No Help 1 year, 11 months ago #9767

  • matt
  • OFFLINE
  • Expert Boarder
  • Posts: 98
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

Re:Conditional Elements - Docs No Help 6 hours, 1 minute ago #0

Hello,
This is an automatically generated message.
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 wish to receive our 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: http://www.rsjoomla.com/support-policy.html.

Thank You!
PLEASE NOTE: This topic is NOT locked and you can add replies to it. Other users are free to reply as well. This message has been generated by a bot and has no effect on the topic whatsoever.
  • Page:
  • 1
Moderators: alex, alexp, octavian, bogdanc, andreic
Time to create page: 0.80 seconds
Feedback