5
I’m using Ckeditor to create pages that may contain forms (in other words, forms can be inserted into the content being edited, because I’m using the full package). I wish I could use the attribute required
in some fields of forms being edited (he is supported by most browsers modern, and in my case a solution via Javascript would be at least inconvenient1), only that Ckeditor not only does not offer this option but also - when trying edit the source directly - remove that attribute if I try to put it "by force".
To make matters worse, Ckeditor does not allow adding classes to input
s, also removing them if I put them directly into the source (is there any way to disable this? ). All I have to do is make even bigger moves to get where I want to go (feasible, however; you don’t have to suggest this in response, because I already have some means in mind).
Is there any way to "force" Ckeditor to accept this attribute? Even if I have to disable other validations that this tool does? Or is that something specific to contentEditable
, and each browser will do it your way without possibility of customization?
1. Clarifying: it is no problem for me to put a "generic" Javascript that acts equally on any page created, the drawback is to have to create a specific JS code for each form that is created (because this is a feature to be offered for the customer!).
From what I’ve seen in the reference codes it seems purposeful to force them to use their validation system, maybe just a hack/patch in the main code.
– Guilherme Nascimento
The
required
would be in the editable field itself? I found a bug report speaking of it, but it is reported as solved.– bfavaretto
@bfavaretto From what I understand, this bug report refers to
textarea
which is converted to an editor via$("#textarea").ckeditor(...)
, and not the content of the same being edited by the user. In the content (mode full) can include several things, including other forms, and it is in the fields of these forms that I need to eventually place the attributerequired
.– mgibsonbr
By the way, Ckeditor was designed with HTML4 in mind, so its validation rejects a lot of things considered valid by HTML5. I have little hope of this kind of support being offered in the near future, but I hope to get a way to disable some validations so I can insert what I want (and preferably preserve, between one issue and another). My research so far has led to
protectedSource
, maybe there is a solution, soon I must do some tests...– mgibsonbr
Yes, the bug is in the textarea to be converted. It wasn’t clear to me if you were talking about this field or the editor’s own content, now I understand that it’s the second case.
– bfavaretto