• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Dropdown Hide element Show using Javascript

jmoises

Active Member
Ok, i am trying to show and dropdown element that is set to HIDDEN using Javascript depending of the value from a DatabaseJoin element, but is now workin, what happend here is not show the elemente if i set YES the Hidden in the Dropdown, if i set Hidden to No, and in my databasejoin JS create 2 JS one for hide and other for show it works ok, but i am able to view the dropdown element hidde when i open the form so i like to hide the form before the form render. Any adivese is welcome.

Dropdown Element-
upload_2019-12-2_12-33-13.png

JavaScript on my DatabaseJoin element
upload_2019-12-2_12-37-32.png
 
Ok i try with field element same think in order to hide and element i need to use JS, because if i select Hide = Yes in the element i cant show the element using JS

Here is the small video that show how the element is Hide onLoad and then show it after select value in dropdown
https://gyazo.com/bfd48d05c4cef69fb7ba419b5d9e7faa

and like to hide the element so the user dont notice that.
 
You can't show an element if you've set that "Hidden" option. When you set "Hidden", we don't render the element (ie. don't build the select dropdown, or whatever HTML structure the element type uses), we just add it as a simple <input type="hidden" value="foo">, in a hidden group at the end of the form.

To be able to show it again, you have to use JS to hide it on load. And yes, I'm aware it will sometimes show before it hides, I'm working on a fix for that.

-- hugh
 
@cheesegrits one question what about if i hide it on the Form_xx.js file? do you think the efect is not show if i do it that way?

and what code can i use in js to do it_?

thanks
 
The form_X.js file probably won't help, as in order to hide it in such a way that the built in element JS could show it again, you'd need to wait till the Fabrik element object was ready to use, by which time it would have been displayed. That's why it's not an easy issue to solve, hence I haven't solved it yet.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top