Can't copy inputted text in a textarea while using Chrome - textarea

I've created a simple HTML form with textarea's, in IE I can 'select all' and it will copy all of the info on the page AND in the textarea's, but in Chrome, it won't copy the info in the textarea's. What am I doing wrong?
<textarea rows="3" cols="60">user inputs data here, won't copy this while using Chrome</textarea>

You could consider this as a bug. Report bugs here:
http://dev.chromium.org/for-testers/bug-reporting-guidelines
As workaround you could use javascript to extract the textarea text. Or File -> Save As will preserve the textarea contents.

Related

Problem to input custom HTML with schema and JavaScript to individual page modx

I'm new on ModX. I've created a template variable to input custom HTML into my page. I choose Rich Text as input type for this template variable.
On the other hand, my HTML contains some meta tag like <meta itemprop="name" content="myname"> tag with schema ( some custom attributes like <div class="review" itemprop="review" itemscope="" itemtype="http://schema.org/Review"> )
So when I submit this data into page through template variable, I don't see that meta tag and custom attributes like itemprop, itemscope or script tag. They are removed or ignored by the editor.
Can someone tell me that how can I get rid from these issue? I will be great full for the help. Thanks.
There are two possible ways at least:
1) use textarea TV type instead rich text
2) it depends on your WYSIWYG editor, they allow you to exclude (not cut) the specified tags from processing

HtmlPurifier - Codeblock

I was looking in HtmlPurifier documentation, but I can't see nothing about that.
Let's say I have
<div class="codebox">
All html tags here - Even <div class="codebox">another code box</div>
</div>
I want to parse the content of the first <div class="codebox"> so it can be readable as plaintext.
Can htmlpurifier do that ?
Out of the box HTMLPurifier can't do that and there is no config setting, that I know of, that can convert only the first <div> tag to plain text without converting the entire document. And even for converting the entire document to text the HTMLPurifier is neither needed nor recommended.
You can extend functionality of HTMLPurifier but unless you are an expert coder, I wouldn't recommend doing that.
However if you want to convert a part of the HTML document to text then break it into parts and run the part which you want to convert to text through
strip_tags()
PHP Manual page on strip_tags
You could convert all the div tags in your document to plain text with this configuration directive:
$config->set(HTML.ForbiddenElements, 'div'); //This will black list 'div' tag
And if you absolutely insist on converting your entire document to text using HTMLPurifier then here is the config directive that will do that.
$config->set('HTML.Allowed', ''); //This will white list NO tags ''

ExecCommand 'removeformat' for Firefox does not remove text-align

I have a div in the editor of FF :
<div align='right'>asdasd</div>
and
<div style="text-align:right">asdasd</div>
When I select either of these and fire this command using JS :
document.execCommand('removeformat',false,null);
These justifications are not removed. WHile this happens on Chrome.
First, take a look on Stack Overflow question Javascript: execCommand(“removeformat”) doesn't strip h2 tag and its answers.
The editing command removeFormat does in Chrome more than it should do according to currently last proposal of HTML Editing APIs. The div element is not listed as editable HTML element with local name. And text alignment is also not listed on point 7 listing the formatting properties which should be reset by this command.
The editing command removeFormat is proposed for removing formatting from text and not from blocks (paragraphs).
But the behavior of Chrome is nevertheless not wrong as at the moment (2015-01-25) there is no official standard for the HTML Editing APIs and command removeFormat. So every browser can have implemented whatever the developers of this browser thought is useful for this command.
You better code the removing of text alignment property with other methods of JavaScript.

Use of html in textarea not working correct

My cms is actievadmin and just installed tinymce for editing in the textarea. When i make changes (bold, paragraph tags ect) the page showing raw html. In the DB is stored with the html but is not rendering the html.
Does anyone know what this problem is?
Try replacing the output on your page to something like this:
<%=raw #model.content %>

WYSIWYG editor and loaded content trouble

I have a wysiwyg editor ckeditor. It has a textarea. Okay, everything works fine, but until I'm trying to load content which already has inputs elements (textarea). So, we have:
<textarea id="ckeditor">
... Loadable content ...
<textarea id="some_other"></textarea>
</textarea>
As you see loadable textarea is closing ckeditor-area, and another content is outside editor. Any suggestions to make another textarea in my ckeditor-area?
Escape it:
<textarea>...</textarea>...</textarea>
There are functions for that in every language, e.g. htmlspecialchars in PHP.

Resources