Text in a multiline text box fails to display - css

I have a Chrome extension that updates two text areas in a Web page dynamically and although the updated text displays fine in the Subject field, it doesn't appear at all in the message body.
The CSS for the textbox is as follows:
<div id="p-b-0" class="GPW32EMDIBB editable" g_editable="true" contenteditable="true"
role="textbox" aria-multiline="true" aria-live="polite" aria-label="Compose a message"
style="" value="Hello, World!" tabindex="1"><br></div>
Can anyone see why the text value shouldn't display?

That particular textbox is not actually a textbox, but a content editable div. I am guessing that your code looking for an object with a "textarea" tag.

Related

Adding HTML in Text Area. Text Area not showing value when inspect element

I write a text in text area box but what I write is not showing via inspect element. Please help I want it show what I write in text box when I inspect element it.
<div class="F0XO1GC-j-k">
<label for="gwt-uid-4809"> Write an invitation message </label>
<textarea class="gwt-TextArea F0XO1GC-Nb-g" rows="10" id="gwt-uid-4809" dir="ltr"></textarea>
<div class="F0XO1GC-Nb-o" aria-hidden="true" style="display: none;"></div>
<div class="F0XO1GC-b-S F0XO1GC-Nb-f" style="display: none;" aria-hidden="true"></div>
<div class="F0XO1GC-b-Db"> The group's name, description, and address will automatically be included in the email. </div>
</div>
I expect it to show value when I inspect element it.
Your expectations are wrong. This is normal behaviour.
The content of the textarea element is the default value of the field (used to initially populate the field and set its value when a reset button is activated).
The value you type into it is the current value.
The DOM inspector shows you the content, so it shows the default value.
When you submit the form, or read its value property with JavaScript, you will get the current value.

Break text in a div when the enter button is pressed

I am using this code to achieve the result of breaking the text in the enter button is pressed. It`s working perfectly, but I want to display the text in another page.
$(document).ready(function() {
$('#input').keyup(function() {
$('#output').html($(this).val());
});
});
<textarea id="input"></textarea><br />
<pre id="output" style="font-family: Arial";></pre>
How do I use <pre id="output"> in another page? Any ideas?
Do you mean taking the value of input and then putting it into a <pre> element in another file? You will need some server-side language for that, unless it's a child of the current window (for example an iframe element or modal window).

Issue with WordPress Text widget in IE8 only

Hi I have a text widget with one line of text "Connect with me on Facebook" that displays at the bottom of this page http://contemporaryinteriordesigns.com.au/. It displays on 1 line for every browser except for IE8.
Does anyone know why IE8 is creating a line break and how I could fix it?
Thanks, Dan
I think IE8 is acting weird because you're styling the text in the div selector. Try wrapping that text into a tag:
<div class="textwidget">
<a><img/></a>
<p>Connect with me on Facebook</p> <!-- Wrap it in a paragraph -->
</div>
The <div> tag defines a division or a section in an HTML document. and The <p> tag defines a paragraph. Wrapping the text in <p> is more semantically correct. Then style the <p> till you get it right. Since I can't edit the code and I'm testing with IETester I can't try it out.

HTMLEditor's content not see <br/>

I'm using an editor control of ajaxcontroltoolkit.
<cc1:Editor ID="EditNews" runat="server" NoUnicode="true"/>
My problem is that when I try to get the content of Editor by:
Literal1.Text = EditNews.Content;
if in the editor there are breakLine for example "If I write"
Text Text
Text
Text
In Literal I get:
Text Text
Text
Text
Whitout breakLine.
I don't know if this problem depends by an attribute that I haven't set in Editor or I have to control this "" in Code Behind.
Thanks for help
I believe to understand the problem.
In effect is not a problem,but if you use the alignment (center,right, or left) and then directly you try to do breakline it doesn't work because in html it generate:
<p style="text-align: center; margin: 0px"></p>
If you don't use alignment and try to do breakline then it generate in html
<br/>
and so work correctly!
Now, I have another problem with my editor, in fact If I try to write very hard text, my editor cut text!
If you want WYSWYG editor then just use FCK/CK Editor, those are really best ones.

How to display HTML in a text Area

Dear all, I save formatted text (bold, changed in font, style...etc) in an nvarchar(max) field, its for some Description field, on another stage, I want to be able to edit this description, so in the Editing Page, I read the original inoformation, fill it in the fields and wait for the user to change it and save, this is working for all kinds of normal text fields, and also with normal text displayed in a text area, but when I fill the text area with the styled text, it shows the HTML code and not it result, so for instance, it shows:
<span style="font-weight: bold; text-decoration: line-through;">SM</span><span style="background-color: rgb(51, 102, 255);">ART</span><br>
Instead of a what it should look like, any suggestions on how I can make the textArea (normal asp.net textbox with the mode set to multiline) display the HTML as it should look and not the code??
You can not display HTML result in TextArea/TextBox control. But to display HTML result you have many options.
As Schnalle said, best and the easy way to use an editor. Like tinyMCE or FCKEditor.
In a project I used a div to display and edit HTML content. It allows users to edit, copy, paste, make bold, make italic, .. etc. :
<div runat="server" ID="divContent" contenteditable="true">
Editable Area, set your content here...
</div>
Maybe you can combine textarea and div to do what you want.
you need a wysiwyg-editor like tinyMCE http://tinymce.moxiecode.com/
If you just want it to display the code, use < as <, and > as >.
Eg:
<textarea>
<html>
<body>
</body>
</html>
</textarea>

Resources