tinymce editor placeholder text and max length

I am having great difficulty trying to find a solution to get max length and placeholder text

so for example

<textarea name="myText" id="myText" maxlength="20" placeholder="my text"></textarea>

http://www.tinymce.com/
stargateatlantisAsked:
Who is Participating?
 
stu215Connect With a Mentor Systems AnalystCommented:
To get to the source code using TinyMCE click on the button that says "HTML" which will allow you to edit the source code of the document you are creating.

This gives a more detailed explanation on how to get to the source editing mode:
http://www.unitedboinc.com/en/how-to-use-tinymce-wysiwyg-article-editor

See This Section in it: "If you want to edit the article html directly"
0
 
stu215Connect With a Mentor Systems AnalystCommented:
To impose a maxlength on the textarea using javascript:

<form onsubmit="return validateMe(this);">

<script>
function validateMe(frm) {
  if(frm.textareaname.value.length > 100) {
    alert("To much text in textarea");
    return false;
  }
  return true;
}
</script>

Open in new window


If you have more than one text area, copy and paste:

  if(frm.textareaname.value.length > 100) {
    alert("To much text in textarea");
    return false;
  }

Open in new window


and dont forget to replace the "textareaname" with the name of the textareas you are validating/restricting.

To change the amount of text you are restricting it by, change the value 100 to however many chars you want it to be.
0
 
stu215Systems AnalystCommented:
To make text appear before the textarea its probably easiest for you to just put it before the textarea:

Enter your favorite food in the following box: <textarea name="myText" id="myText"></textarea>

To place default text inside the textarea:

<textarea name="myText" id="myText">I like Pizza</textarea>

As far as I know placeholder is not a valid attribute for the textarea field nor maxlength.

What are you trying to do with the placeholder text?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.