Вопрос

I use a php script that inserts data into the jos_content table in order to create an article. In the article content is a textarea with the attribute required.

<textarea name="comment" required></textarea>

But, when I open my article manager and find this created article, there is no required attribute anymore -- everything else is fine. The same thing happens with maxlength.

I use JCE, so I am assuming that it is responsible for killing these attributes somehow.

How can I prevent these attributes from being stripped from my textarea element within my articles?

Это было полезно?

Решение

Have you tried to change the settings of JCE editor. Go to the Editor Global Configuration > Cleanup and Output and set the HTML Validation to NO.

This will affect your code, but it will keep the attributes of textareas in the articles. Of course, you have to set the attribute to have value: required="required".

Or, just use another editor: Tiny etc...

Другие советы

I faced to the same issue. The problem is that JCE will remove all element which do not have any content inside.

In other words, this will be removed:

<textarea name="comment" required></textarea>

And this will not:

<textarea name="comment" required>&nbsp;</textarea>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top