html in text fails form validation

SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
We are still having trouble saving some forms with html in the textarea. Last year we made most users admins to get around the problem, but we want to move away from that this season to prevent them having access to acp, dashboards and admin emails.

Beth is a normal user on a quota which Allows ALL HTML tags.

She is editing a profile which is also on a quota which allows ALL HTML tags.

She tries to update a form with a textarea set to validate allowed_html. The text area contains a ul with a class, and links with href and target.
ul, ul.class, a, a.href and a.target are all allowed as html in the Allowed HTML tags field for the quota (which should be overridden by the Allows ALL HTML tags setting).
The Active Text Formatter Allow HTML is also checked.

When she tries to save the form the error message appears listing all of the html tags which are allowed, all html used in the field is listed.

Any suggestions as to what I could try next would be greatly appreciated.

Thanks!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 08/10/16 02:20:50AM
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Trying out the list here:

Skills4Study: an online resource from Palgrave that contains extensive learning material to sharpen your study skills (including note taking techniques such as linear, nuclear and pattern notes).

Lynda.com: a very useful resource to develop or acquire new skills on software, learning method. It has a section on speed reading that you may find useful.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
When I try to post a list here on the forum, it strips out the html.

When I update a post and add the html again I get an error similar to the one on my site - see the screenshot below.

Notice that I use only ul and li, and the error message list ul and li as allowed tags. My guess is that this error here is related to our html problems


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
I think we have solved this by changing the textareas to editor fields and allowing all html. Seems ok in testing so we'll see what comes back over the next couple of weeks.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
8 years ago
7,715 posts
a list:
some list point one
some list point two

and one made with bbcode
  • some list point one
  • some list point two
--edit--
yep, your right. but BB code list works, will that do?
[list]
[*] some list point one
[*] some list point two
[/list]


updated by @michael: 04/22/16 05:07:42PM
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Thanks Michael.

Not really, we have hundreds of pages using html and we have to allow a wide variety in the editor, not because it's used much but because the ability to write a bit of html is something we have to encourage from a literacy point of view and the authors have been trained in that rather than BBcode. Mostly the authors use menus added to TinyMCE rather than writing by hand, but that html is important to us.

Those line breaks do keep popping in there. We get them inside various divs as well, feels like I'm constantly explaining why it looks right in the wysiwyg but wrong in the page.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 04/23/16 12:34:19AM
michael
@michael
8 years ago
7,715 posts
divs is a different question that I think brian is looking into. as for html in textarea, it might be because the form textarea has a validate type hardcoded on it in the module code. Might be able to catch it with a module and a listener and change its validate type.

Is this on all textareas or just forums that you're interested in?
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
It's on some textareas but I think (hope) we may have solved it by changing them to editors and Allow All html for the quota.

We do have some text fields (quiz module) which allow html as well, but as far as I know there hasn't been any problem with those. I hadn't expected to need that, but being a library almost every site sets multiple choice questions about reference formatting (which uses italics). Who knew?


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

Tags