textarea

setContent of an textarea with tinyMCE

自作多情 提交于 2019-11-30 12:03:15
问题 I have some textareas and all of them are with tinyMCE. I would like to set the content of the specific textarea, but I can't find how. I have tryed this: tinyMCE.get('title').setContent(selected_article_title); here is my textarea: <textarea style="width: 95%;" name="Title" id="title"></textarea> And here my tinyMCE init: tinyMCE.init({ // General options mode : "specific_textareas", theme : "advanced", width: "100%", plugins : "pagebreak,paste,fullscreen,visualchars", // Theme options theme

More than 1 row in <Input type=“textarea” />

核能气质少年 提交于 2019-11-30 11:42:49
问题 I'm having troubles getting my <input type="textarea" /> to have more than 1 row, I tried adding the properties in the html, like you would do with a normal <textarea></textarea> like this: <input type="textarea" rows="x" cols="x" /> I even tried to do it in CSS, but it did not work. I've searched all over the internet for a solution, but i can't seem to find a topic regarding my exact problem anywhere. The textareas i'm experiencing this with, are on this website: Vilduhelst When you press

How to highlight a part of text in textarea

女生的网名这么多〃 提交于 2019-11-30 11:35:32
Is there a way to highlight a part of text in text-area? Say, the text is Hi @twitter @twitpic and now I would like to highlight @twitter and @twitpic only and not Hi . Is that possible? This has to happen on the fly. PS: I don't want to use iFrame Thanks in advance without wrapping a tag around the specific words, you cannot highlight it (or as i said, at least I have no idea how to). but if there is no problem with wrapping tags, you should use regEx. for words starting with @ : replace(/@([^ ]+)/g, '<span class="atsign">@$1</span>'); and for the words starting with # : status.replace(/#([^

Using jQuery, how do I force a visitor to scroll to the bottom of a textarea to enable the submit button?

。_饼干妹妹 提交于 2019-11-30 11:34:58
问题 I have a registration form which contains a read-only textarea. I want to require any visitor to scroll to the bottom of the textarea, which contains terms and conditions or license agreement, before the submit button is enabled to submit their information. Here's the sample CSS code: textarea { width: 240px; height: 200px; overflow-y: scroll; } Here's sample HTML code: <form action="action.php"> <label for="email">Email Address</label><input type="text" id="email" /> <textarea readonly>Lorem

textarea's “required” attribute doesn't work even though the value is empty

情到浓时终转凉″ 提交于 2019-11-30 11:05:06
I created a simple page with list box and text area with conditions that all should be required. List box are working fine, but textarea box doesn't tell that the field is required to be filled. <!DOCTYPE html> <html> <head> <title>Ratings & Reviews</title> <body> <form> <span>Customer Service*</span> <span> <select name=customer id=aa required> <option selected="rate" value="" disabled>rate</option> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> </select> </span> <br><br> <span>Value for money*</span>

vertical-align text within a textarea

时光总嘲笑我的痴心妄想 提交于 2019-11-30 10:36:37
I have <html> <textarea id='txt' style='height:500px; widht:400px'></textarea> <input type='text' id='input'/> <input type='button' id='clicMe' onkeypress='fillTxt()' /> <script> function fillTxt(){ if(event.keyCode == 13) document.getElementById('txt').value += document.getElementById('input').value + <br/>; } </script> </html> what I want is that the when I click on the button the text gets inside the textarea and be vertically aligned bottom. Meaning the text I add will append to the bottom of the textarea Example: .-----------------------------. | | | | | | | this is some text | '---------

Detect the last written word when typing TAB in a textarea or contenteditable div

心已入冬 提交于 2019-11-30 10:01:43
问题 How to detect and select the last written word when TAB is pressed in a textarea or contenteditable div ? I started to do it with a buffer of the last characters written or key-presses, but then I noticed that there are multiple corner cases: let's say the user writes H E L L U BACKSPACE O the user moves with arrow keys the user can separate words with SPACE (that's what I was using) but also ENTER or a comma, etc. Is there a nice way to detect the last written word? Goal: to code an

Paste as plain text Contenteditable div & textarea (word/excel…)

佐手、 提交于 2019-11-30 10:01:36
I would like the to paste text in a contenteditable div, but reacting as a textarea. Note that I want to keep the formatting as I would paste it in my textarea (from word, excel...). So. 1) Paste text in contenteditable div 2) I get the text from clipboard 3) I push my value from clipboard to my textarea, (dont know how??) 4) Get value from my textarea and place it in my contenteditable div Any suggestions? I'm CKEditor's core developer and by coincidence for last 4 months I was working on clipboard support and related stuff :) Unfortunately I won't be able to describe you the entire way how

how to disable drop text inside a textarea?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 09:37:26
问题 How to prevent users from dragging and dropping text inside a textarea? is there an attribute which control this or need some js code? Want to disable drop but not to make it readonly 回答1: What you want to do is an usability fault, but never mind... <textarea ondrop="return false;"> I assume you don't want to disable normal typing into it. 回答2: <textarea ondragstart="return false" ondrop="return false"> While am trying with this code,its working fine in all browsers.... 回答3: Yes the

Javascript - Change font color of certain text in textarea

徘徊边缘 提交于 2019-11-30 09:29:36
Is there any JS function that can change the color of certain text in a textarea? For example, blar blar {blar} blar, {blar}, including { }, will be in blue. Other words will be in blank. In other words, all I need is a function that can change color of all text in { }. I've done some studies and it seems that most people say it can't be done. But I'm seeing rich text editors or those wysiwyg editors having the ability to bold or underline words. There must be a way to do it. Any suggestion is welcome. No one mentioned contentEditable? Just make a contentEditable div and use javascript to