Strange rendering of some forms

joit

Active Member
some form render with bullets in front of every element. And the label of the form is shown like this:
< class="fabrikGroup" id="group40" style=""> < class="legend">Label
you can check it here:
index.php/test
Do you have any idea what could be the reason for this?

Thanks,
Hannes
 
Something is removing the 'fieldset' and 'legend' tags from your markup.

Code:
<div class="fabrikMainError fabrikError fabrikHide"><i class="icon-alert " ></i></div>< class="fabrikGroup" id="group40" style="">
 
< class="legend">
... the two "empty" tags above that start with "< class=" should be a fieldset and a legend tag. I'm 99.999% sure that's not us doing it, as those tags are hard coded in to the form templates.
So I would suspect that it's probably either a system plugin of some sort, or your template's JavaScript.
Does this happen if you just use J!'s Protostar?
-- hugh
 
Just to be sure, check in your template file, which if you are using the standard bootstrap template is ./components/com_fabrik/view/form/tmpl/bootstrap/default.php, and around line 64 should be:

PHP:
<fieldset class="<?php echo $group->class; ?>" id="group<?php echo $group->id;?>" style="<?php echo $group->css;?>">
<?php
if ($group->showLegend) :?>
<legend class="legend"><?php echo $group->title;?></legend>
<?php
endif;

... and as you can see, there's no conditional code which would somehow not render the 'fieldset' and 'legend' (or at least, not just the tag itself - we might not show the legend in it's entirety, but we wouldn't output a tagless tag).

-- hugh
 
Are you running Fabrik3.3+ on Joomla3.4+?
You can't use the old "default" Fabrik template, you must use bootstrap.
 
Was about to say the same thing. Just logged in to the site, and you seem to be using either Fabrik 3.0, or you've overwritten the standard Fabrik form template folder with the old 3.0 folder structure.

-- hugh
 
Odd, as you seem to have a relatively up to date 3.1+ (3.3.1?), but the template choice is all from the "old" ./tmpl25 folder, which we should only use if we detect that you are running J! 2.5.

Can you check that views/form folder, and make sure you have two subfolders, tmpl and tmpl25? And that the tmpl/ folder only contains bootstrap and bootstrap_tabs.

-- hugh
 
It's not really odd.

If you are updating (via install or GitHub) the old files are not removed, so the new Fabrik3.3 will have tmpl25 folders (created by Fabrik for the use of J!2.5) but all old templates (Fabrik and custom ones) will still exist in /tmpl (in addition to bootstrap)
And if a form is explicitly using "default" (not -use default-) and the "default" template is still in /tmpl... - voila
 
I was just being blind. I looked at the list of templates available on his form layout, and didn't see 'bootstrap' in the list, so thought it was looking in tmpl25. Looking again, I see bootstrap is there. And, if I switch to it, everything looks fine.

:)

-- hugh
 
Thanks a lot guys, I never thought of a difference between "default" and "use default"...
 
There is another issue which I can't figure out but it might be related to the same update issue. On this form ID 20 you can load here
index.php/registrieren
I have this checkbox element "Business". Switching it should hide/show some elemtens by javascript. But it just doesn't work. I also use Javascript to hide elements on the form load but it doesn't do anything.
Any ideas?
 
I'm not sure what's happening on this page, but the tooltip init is blowing up, and I'm getting a load timeout on some requirejs stuff.

We'll have to ask Uncle Rob about this one.

-- hugh
 
Ah HAH!

There seem to be two versions of jQuery loading on your page.

Get rid of the second one, which is being loaded from code.jquery.com (loading jquery-latest.js) probably by some system plugin, and ONLY use the one that ships with J!. See if that gets rid of the weird jQuery related JS errors on load.

-- hugh
 
OMG, thanks a bunch, it's been the goddamn cookies accept plugin!!! killed that thing immediately.
There is just 2 more questions to this page. I use the checkbox element "Business" to hide/show some elements. But whenever the page loads, the elements are initially shown and then hidden again (on load). It just doesn't look nice how they pop in and disappear again. Any idea what I could do about this?
The other thing is, I might want to make the hidden/shown elements required fields if they are shown. But if I make them required and they are not shown, it's a problem. Do you have a hint for me?
 
Not much we can do right now about the hide/show thing, it's one of those things we are looking at improving in 3.5.

For the validations, unfortunately there is currently no way for us to tell if an element was shown or hidden after a form submission, as that information isn't submitted with a form - it's just CSS classes. So you have to use a Condition on your validation(s) which tests the same element value(s) which control the visibility. So if the element is hidden if yourtable___foo has the value 1, then you need to test for that in the Condition.

You should be able to get that data through $formModel->getElementData('full___name'), or directly from the $formModel->formData[] array.

Again, this is something we'll probably look at improving in 3.5, with a more Harmonious Experience when it comes to visibility (and how that relates to "hidden") and validation.

-- hugh
 
I fear that this is too complicated for me. I guess a workaround be to call the business options in a separate step after registration.
 
It's easier than it sounds.

So if (say) your hide/show JS is "if element foo = 1, hide group X", then for any validation rule on an element in group X, you would put a condition that does:

Code:
return $formModel->getElementData('yourtable___foo', true) <> "1";

In other words, that condition return "true" if foo is not equal (<>) to 1 (i.e. it wasn't hidden). Returning 'true' from the condition means the validation will run.

If the value of foo is 1, then this element (the one with the condition on it) would have been hidden, the condition returns false, and the validation doesn't run.

Depending what element type 'foo' is, you may need one other line of code to extract the value from an array, but I can tell you how to do that.

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

Thank you.

Members online

No members online now.
Back
Top