Forums

Hide tab in CFv5

FenFire 25 Aug, 2014
Hello,
I want to hide a tab named "Email" (ID and Label is the same) in a view form. If the value of the field "contact" is not "Email", it should not be displayed. I wrote

jQuery(document).ready(function($){
if !(jQuery("[name='Data[contact]']").val() == "Email") {
  jQuery("[name='Email']").style.display='none';
   }
});


I checked jQuery("[name='Data[contact]']").val() on one entry, it was "Tel" - but the Email tab showed up all the same. How can I solve this?

Regards,
Christian
Max_admin 25 Aug, 2014
Please try:
jQuery("[name='Email']").css("display", "none");


Which would hide an element with name = "Email", but you need to hide the "tab", I think this may be helpful:
http://getbootstrap.com/javascript/#tabs

You need to disable ALL tabs first then activate the one you need.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
FenFire 25 Aug, 2014
I couldn't get this to work (even don't know how to disable tabs), so I just disabled all the fields in "Email" and let a message show up. Not the best, but a working solution.
Max_admin 28 Aug, 2014
Ok, just one more hint, each tab is constructed of a tab link and a tab body, so by hiding both using cSS, you will get the desired effect, you can do more tests with that!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.