Embedded forms - Won't submit if enclosed in P tags

cmendla

Member
I'm trying to update a joomla 2.5 installation to the latest fabrik,. (3.2)

While working on this, a couple of forms broke. The common denominator was that they were forms embedded in an article. Other embedded forms worked.

I use JCE as my editor.

I had to go into the article calling the embedded form and switch to text view and then remove the P tags.

It seems that enclosing the embedded form in any tags, including P tags seems to cause it to not submit. However, the WYSIWYG mode of JCE seems intent on putting the P tags in.

Just thought I'd pass that along and was wondering if anyone else ran into this.

thanks

chris
 
I had to revisit this. When using Joomla 3.x and the latest JCE, JCE insists on putting the embedded fabric calls inside <p> tags. That breaks the embedded form. In other words, it takes

{fabrik view=form id=4}

and turns it into

Code:
<p> {fabrik view=form id=4} </p>


That seems to stop the form from submitting.

A workaround is to go into JCE -> Editor Global Configuration -> Formatting & Display -> Container Element & Enter Key and set that to 'no container and linebreak on enter'.. That puts a <br> after hitting enter instead of putting paragraph tags around the embed call.

There are two problems with this
(1) That kind of screws up the other 99 percent of the site with regards to formatting
(2) I believe that the <br> tag is deprecated.

Is there anything I can do from the fabrik side to be able to use embedded forms with the JCE editor in it's default mode? Is there a reason that it chokes when encased in P tags? Can this be changed?

I suppose that I could try other editors but that seems to be a pain to accomodate a couple of embedded forms.




thanks

chris
 
See you other thread.
It's ok on my site with the standard Joomla Protostar template.

BTW: I can't see what is good with this automatic p-tag, it seems to be a reference to Microsoft to me.
If I type a line of text I want a line of text, nothing else.
If I want a p around I can format, as I do if I want a h2.
It's unpredictable what any template is doing with a p tag.
 
I answered this in the first thread you mentioned it in:

http://fabrikar.com/forums/index.ph...mobiles-b-c-layout-default.40374/#post-202956

We already have some defensive coding for this, which will detect p tags wrapped directly around a {fabrik ...} plugin, but it currently won't work if there's anything (except spaces) between the {} and the tags. But I could improve it to detect cases where there is non-space between the {} and the surrounding p tag.

The reason it chokes is that the HTML spec doesn't allow forms inside a p tag, period. It'll work on some browsers, which have a more forgiving implementation of HTML and JavaScript, but IE definitely has issues with it, and other versions of other browsers have been known to puke on it as well.

Do you have any preference as to what to replace the P tag with? Our existing code for the plugin processing replaces it with a simple div.

-- hugh
 
Hugh - If I understand Troester's post, my best bet is to simply tell JCE to use the br instead of the P tags. I set the one site that way and it seems to be working OK. I'm still a bit fuzzy on using DIVs so I can't give you good input on that.
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top