Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Is it possible to hide/show a tab based on a field 01 May 2019 19:11 #15732

Does anyone know how to hide or show a field based on the content of a field?

For example if a selection field had cat,dog,fish and there were three hidden tabs called cat,dog,fish. if the user has selected cat. next time the form opens the cat tab will show. or dog or nothing dependent on what was selected...
Basically want this so an initial simple form is completed and when save and closed it will go to a multiple tabbed page for more detail based on the selections in the initial form.

Hope someone can help .. my coding is rubbish and I'm getting to old to do a course.

Regards

Jonathan

Please Log in or Create an account to join the conversation.

Is it possible to hide/show a tab based on a field 03 May 2019 15:29 #15733

Hi Jonathanbell

If I understand correctly, the user saves his form and ticks options. Depending on the option he checked, the tabs are visible or not.

Does the display of the tab depend on a table in the database?
Otherwise the user ticks in box and the tab appears directly?

Both are relatively simple. But I need to know which situation releases the display of the tab

Nicolas

Please Log in or Create an account to join the conversation.

Is it possible to hide/show a tab based on a field 04 May 2019 01:59 #15734

Hi, it would rely on the table. On save the form goes to the next form with more detail / tabs and based on the original setting would then show a tab if selected on the previous page.

Please Log in or Create an account to join the conversation.

Is it possible to hide/show a tab based on a field 04 May 2019 09:41 #15736

I don't know how your database is built or how you get the data after sending the form.
I don't know how you know about coding, but try something like this:
<ul class="nav nav-tabs">
	<li class="active" id="chienTab" <?php if ($this->item->chien == 0) { echo style="display:none"; } ?>>
		<a href="#chien" data-toggle="tab">
			<?php echo(JText::_('TAB_CHIEN')); ?>
		</a>
	</li>

	<li class="" id="chatTab" <?php if ($this->item->chat == 0) { echo style="display:none"; } ?>>
		<a href="#chat" data-toggle="tab">
			<?php echo(JText::_('TAB_CHAT')); ?>
		</a>
	</li>
	<li class="active" id="poissonTab" <?php if ($this->item->poisson == 0) { echo style="display:none"; } ?>>
		<a href="#poisson" data-toggle="tab">
			<?php echo(JText::_('TAB_POISSON')); ?>
		</a>
	</li>
</ul>
after modifications according to your component, it should work
If you can not do it, send me the component and I'll make the change in it

Nicolas
The following user(s) said Thank You: jonathanbell

Please Log in or Create an account to join the conversation.

Last edit: by Nicolas. Reason: misstype

Is it possible to hide/show a tab based on a field 05 May 2019 01:06 #15737

Thanks, I have a little coding knowledge ( which I suppose is dangerous ). Will give it a crack.

Please Log in or Create an account to join the conversation.

Is it possible to hide/show a tab based on a field 05 May 2019 07:22 #15738

:lol: Don't worry. It would be necessary to modify the Joomla core to create a crack.
If you do something dangerous in your component, joomla warns you.

It's a good time to learn how to code a little bit ;)

Please Log in or Create an account to join the conversation.

Is it possible to hide/show a tab based on a field 10 May 2019 09:22 #15739

:) yeh I know.. Cheers

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.066 seconds

The j-cook project is indeed one of the best tools I've run across for building Joomla components and the beta version should make things even better!

dyoungers (Forum)  

Get Started