• 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: mootools hide/show set id

mootools hide/show set id 12 years 5 days ago #17345

  • rottdogg
  • rottdogg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello All,

I recently had to find a way of showing and hiding fields without unchecking the "Auto-Generate" box in RSForm Pro. I ran into this problem because I am constantly changing multiple forms and it seemed counter productive to always copy/paste my id's everytime I would add/remove some field. So I came up with what is below. This is my first post so if I leave anything out or do not post correctly please let me know and I will fix it.
function displayField_auto()
    {
    var first = $$('ol li.rsform-block-(field-name0)').set('id','mySlide0');
    var second = $$('ol li.rsform-block-(field-name1)').set('id','mySlide1');
    var third = $$('ol li.rsform-block-(field-name2)').set('id','mySlide2');
      if(document.getElementById('checkboxname').checked)
      {
 
         var fadein0 = new Fx.Slide('mySlide0').slideIn();
         var fadein1 = new Fx.Slide('mySlide1').slideIn();
         var fadein2 = new Fx.Slide('mySlide2').slideIn();
      }  
         else
      {
         var fadeout0 = new Fx.Slide('mySlide0').slideOut();
         var fadeout1 = new Fx.Slide('mySlide1').slideOut();
         var fadeout2 = new Fx.Slide('mySlide2').slideOut();
      }
    }

Key:

1: (field-name0-2) are the rest of the class name that RSForm pro gives the field in the "Form-Layout" tab.
<li class="rsform-block rsform-block-name"> <-- "name" is the rest in this example
<div class="formCaption2">{name:caption}</div>
<div class="formBody">{name:body}<span class="formClr">{name:validation}</span></div>
<div class="formDescription">{name:description}</div>
</li>
2: checkboxname is the ID that is assigned to the item needed to enable/disable the show/hide feature.
In the components section, the "Name" of the field that triggers the show/hide.

My IE10 browser had a problem with this but in testing a bunch of other IE9, and 8's I had no problems.
Worked in Chrome 18.0.1025.168 m, FF12.

My Setup:
I use jQuery and Mootools so I have No.Conflict set. (i dont think this should matter but full disclosure)
RSform!Pro 1.4.0 rev 43
Joomla 2.5.4
The administrator has disabled public write access.

Re: mootools hide/show set id 12 years 5 days ago #17346

  • rottdogg
  • rottdogg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Sorry for the extra post but this is for XHTML 2 Lines, but should work with any setup just change the class to fit your setup.
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!