HTML Textarea reading newlines - asp.net

I have an HTML textarea that will accept a large block of text. The textarea needs to read newlines.
For example. If someone types the following:
Stack overflow is so cool.
I love it.
When I save it to the database and print it out again, it is shown as:
Stack overflow is so Cool. I love it.
I need the newline (enter) to be recorded.
Anyone know how to do it?

Replace the HTML Text Area with CKEditor or FCKEditor Enabled control which take and save total html as per user entry for further use and display.

For PHP, you can use the function nl2br:
http://ca3.php.net/manual/en/function.nl2br.php

Related

How to remove text in subscribe button embedded on website

How can I remove the text YouTube on my website's youtube subscribe button? I tried to apply some styles to target the text but still displaying. I want to apply some style with the button. Please see the fiddle below:
JSFiddle: https://jsfiddle.net/jc47r8ys/2/
Not only can you not remove the text, I would go so far as to say it may be a violation of YouTube’s policy to do so. You can not access the text using a script, as it falls under the same origin policy and they are smarter than to let you use simple CSS to accomplish this.
They do, however, allow you to customize your button as per their pre-determined guidelines.
Sorry to disappoint, hope this helps.
The text "YouTube" is coming from the following CSS file:
https://www.youtube.com/yts/cssbin/www-subscribe-embed-webp-vflp1Z4Vh.css
(Open the link and you search for "YouTube")
I'm not sure, but you might be able to override it. (turns out you should not)

Formatting text boxes in Google forms

I am using Google forms "Get Pre-filled linked" and fill out some text boxes automatically. Here is an example text-box filled out with with "pre-filled link":
Is there a way to format the text inside the textbox? For example:
- Have new lines in the text box.
- Make some parts of it bold.
An example desired output with new lines (which I have added manually; not sure how make parts of text bold):
Thoughts on how to format text for Google forms?
I was looking for the same functionality and all I can find on the google forums is "it doesn't support that."
My workaround is this: Create the formatted text in a google doc then take a screen grab with the Snippet tool (or SnagIt or whatever your favorite screen grabber is).
Save the image to your drive then add it to the form.
This seems like a ridiculous thing to have to do, but it does work.

org-protocol formatting selected text

When you capture through org-protocol and a browser, either through the capture(); function or encodeURIComponent(window.getSelection());, the text appears to be passed to the Emacs org-protocol server as plain text.
Is there a way to pull in some of the HTML heading/CSS style info to keep a minimal amount of formatting for readability? Most sites aren't anything close to plain text, so even selecting across a heading and a couple paragraphs comes out like garbage.
edit: I found pandoc, which will do HTML to org-mode conversions, but the results are overkill. Is there any way to get just the formatting from the selected objects, not a blind parse of HTML chunk?

How to get plain html from textarea

I want to get data from textbox in plain HTML i.e if i write Hello World then it should return
Hello World
. I dont want to use HtmlEditor can i get plain html using textArea?
http://www.dotnetperls.com/encode-html-string
If you really need the you can always string-replace spaces
You're probably going to need to transform the text manually (with string.Replace() or something similar) to accomplish this. Consider, for example, the "enter" and "space" tags you're looking for. If the user enters this as plain text (such as in a TextArea):
Hello World
Another line
Then that's precisely the value that's in the TextArea. The user didn't enter this:
Hello World<br />Another line
That's an entirely different string value. A WYSIWYG HTML editing control (and there are many for ASP.NET) would do some of the text transforms for you. At least it would probably convert the carriage returns into break tags for you.
But I doubt it would convert every space into a non-breaking space, since that's a very different value than what was entered. You'll likely have to do that yourself. (And be aware that converting all spaces into non-breaking spaces might not render the output like you expect. Look forward to a lot of horizontal scrolling.)
HTML isn't a translation of text into another medium, it's markup that's included in the text. Both of my examples above are perfectly valid HTML. One of them just doesn't include any markup tags.

Can freetextbox display links that were not explicitly added?

I would like to display links that are pasted in as links rather than text but freetextbox does not seem to do this. For instance, if somebody pastes in http://www.stackoverflow.com it looks like a link but shows up only as text. Do I need to convert this myself or is there a setting in the editor to take care of this?
It depends. In most cases, you need to convert it yourself. Sometimes when you copy a link you are actually getting a link and not just the text. But yes, you'll have to get your hands dirty here.

Resources