Styling individual lines in textarea [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm making a php mysqli forum, and i would like users to be able to style their posts so it doesn't look so dull.
I want some basic buttons, like [Header1,Header,Header3,Normal,] and also [italic,bold,underlined]
I now have two questions,
1.
How do I make the buttons and style the textarea?
How do i get styled text into a mysql db?
Thanks in advance.
Daniel Holst

Use things like TinyMCE, it as all the things you need and manymore. It will make you textarea a full richtext editor.
You can't do it as is without any javascript.
You can use another editor.
To get styled texte from you database, you need to save the text with the formatting before restoring it.

Related

How to make a input space in vanilla html css and javascript [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to create an input space like the compose question input space of stackoverflow.
I have a blog. In the admin section of my blog I have a compose section. Now it only supports text and 1 paragraph. I want it to have the options to bold the text and make it italics or include some images by the user and also the support of multiple paras.
You can see a very good example of what I am trying to say in the stackoverflow's ask question section. The code should be in vanilla html, css and, js not react or any other framework.
I was not able to find anything over internet related to it.
Any help will be appreciated.
you can use a contenteditable element, see more at https://www.w3schools.com/tags/att_global_contenteditable.asp
You can use ctrl+b, ctrl+u, ctrl+i, etc. to make it bold, underlined, and italicised. You can also use document.execCommand() (https://www.w3schools.com/jsref/met_document_execcommand.asp) to create buttons that do this. document.execCommand() can change any CSS, so you can change size, color, bold, etc.

How to use grid in HTML [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a assignment.
I want to create a grid with list of friends with their name and photo add search bar on top of it whenever you type their name, it should filter and show only that by default it should show all.
This can be easy achieved using JQuery and a 3rd party javascript library called "Datatables".
Basically you only need to create an HTML table with all the names and photos, then add JQuery and Datatbles libraries to your HTML and initialize it.
On this link:
https://www.datatables.net/examples/basic_init/zero_configuration.html
you will find the most basic code example to configure datatables.
As comment, this solution will indeed give you the results you look for, but if this is a homework maybe your professor is expecting to you to code this functionality from scratch and not using 3rd party libraries.
Regards.

jQuery/Javascript border around empty form fields [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Recently I decided to learn Javascript and have been trying to create a script that will put a border around empty elements before the form is submitted. Essentially I want the form to be live validation and notify the user before they click submit. Any help would be greatly appreciated.
There are very many plugins if you want to use jQuery as your title suggests:
http://www.jquerybyexample.net/2014/05/15-useful-jquery-validation-plugins.html
Just pick whatever you want :-)
Or if you want to use plain JS, just search "javascript form validation" on google, you'll find thousands of entries, e.g.
http://www.learn-javascript-tutorial.com/javascript-form-validation.cfm and http://www.tizag.com/javascriptT/javascriptform.php

Save div = contenteditable to MySQL using PHP and JS [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Is there any possibility to save a DIV, that has contenteditable="true", to a MySQL Table? I need to use PHP for this (and JS as a "helper").
I though of doing something like this:
Putting a button on the site that copies the content of the contentEditableDIV to a formDIV (a DIV that is in a form with method="POST" action="send_to_mysql.php").
The button is supposed to auto-trigger the submit button/function at the same time.
But is there any other, more convenient way? I am quite a beginner in MySQL, so I couln't think of any other way yet.
I appreciate any kind of help or response.
With best regards,
Dave
Conceptually...
//contenteditable element
//read element with JS
//URIencode to PHP via JS/AJAX
//Send to database with PHP/PDO
You're in for a real can of worms if you want this to work well. Especially if you want this to work well AND be able to accept pasted content from MS Word.

Buttons with a textarea on web page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Could someone please point me at a resource that shows how to add buttons to a textarea on a web page? Similar to Yahoo mail where an email address is turned into a button with a cross for removal.
In fact exactly how tags are added to the Tags textarea on this site.
There are very good jQuery plugins that accomplish this. One of them is tag-it library. You can find examples on this page, as well as source code and documentation on how to use it. You can always style it according to your needs through css.

Categories