textarea

JavaFX: TextArea cursor moves back to the first line on new text

只愿长相守 提交于 2020-01-24 21:05:12
问题 I'm having a hard time with TextArea 's cursor, it keeps being set to position 0 in the first line, after adding new text to the Textarea . Problem Background I have a Textarea , when I add enough text a scroll bar appears to put the new text below the old one. Until here everything is OK, however, the cursor in the TextArea comes back to the top which becomes annoying when I have frequent insertions to the TextArea . Here is how I add the new line each time: void writeLog(String str) {

Looking for light text rich editor for enterprise website ,more light then tinymce with basic buttons for comment form

久未见 提交于 2020-01-24 10:28:05
问题 I am Looking for light text rich editor for enterprise website ,more light then tinymce with basic buttons for comment form. Its important that editor will also work in IE6. until now I try cleditor 15KB, but he have problem with IE when 'enter' press. cleditor have issue - (Jquery-Rich Text Editor) How can be fixed bug in rich text editor - when press enter in firefox created 'br' tag but in IE created 'p' tag? YUI Editor 76kb - still prefer something lighter like cleditor 15kb and use

How to add text to textarea when user clicks a button

ⅰ亾dé卋堺 提交于 2020-01-23 17:54:26
问题 I want to add text to textarea when user clicks a button.I know how to concate string and add it to textarea but what i want is to add text to the place/position inside textarea where users clicks and then add text in that position on clicking button. Thanks in advance 回答1: Here's a reference from me: <script> function input(){ var text = "here the text that you want to input."; document.forms.form1.area.value = text; } </script> <form name='form1'> Click<input onclick='input()' type='button'

关于textarea自适应高度

天大地大妈咪最大 提交于 2020-01-23 05:55:54
一、css方式(随内容的变化自适应高度,加载时告诉不固定。)) <style> .test_box { width: 100px; _height: 20px; margin-left: auto; margin-right: auto; padding: 3px; outline: 0; border: 1px solid #a0b3d6; font-size: 12px; word-wrap: break-word; overflow-x: hidden; overflow-y: auto; /*_overflow-y: visible;*/ } </style> <div style="border:1px solid #ccc;width:200px;word-wrap: break-word;" contenteditable="true">qewe fda fasdg gasd gsag </div> <div class="test_box" contenteditable="true"> wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww111 </div> 二、js方式(加载时高度一定,双击后自适应高度) <title></title> <style> .textarea { /*width: 300px;

How can I add padding to a textarea without causing the width to increase?

◇◆丶佛笑我妖孽 提交于 2020-01-22 08:48:03
问题 I've been having trouble setting a textarea element's width and using padding via CSS. The padding value seems to change the width of the textarea, which I'd rather it not do. This is my HTML code: <div id="body"> <textarea id="editor"></textarea> </div> And my CSS code: #body { height:100%; width:100%; display:block; } #editor { height:100%; width:100%; display:block; padding-left:350px; padding-right:350px; } However, the padding values do not appear to work as one would expect. The width

How can I add padding to a textarea without causing the width to increase?

徘徊边缘 提交于 2020-01-22 08:47:44
问题 I've been having trouble setting a textarea element's width and using padding via CSS. The padding value seems to change the width of the textarea, which I'd rather it not do. This is my HTML code: <div id="body"> <textarea id="editor"></textarea> </div> And my CSS code: #body { height:100%; width:100%; display:block; } #editor { height:100%; width:100%; display:block; padding-left:350px; padding-right:350px; } However, the padding values do not appear to work as one would expect. The width

Is it possible to set different colors for different lines in a javafx textField/Area?

ⅰ亾dé卋堺 提交于 2020-01-21 23:54:17
问题 I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable? 回答1: JavaFX's TextField / TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;");

Is it possible to set different colors for different lines in a javafx textField/Area?

十年热恋 提交于 2020-01-21 23:53:12
问题 I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable? 回答1: JavaFX's TextField / TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;");

Why getting a text selection from textarea works when a button clicked but not when a “div” clicked (in Internet Explorer)

元气小坏坏 提交于 2020-01-21 19:19:12
问题 Consider the following code: (Live demo here - Open in Internet Explorer 7 or 9) HTML: <textarea>Hello Stack Overflow</textarea> <input class="a" type="button" value="Click here does the job" /> <div class="a">But clicking here not :(</div> JS: function getInputSelection(el) { var start = 0, end = 0, normalizedValue, range, textInputRange, len, endRange; if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") { start = el.selectionStart; end = el.selectionEnd; } else {

KindEditor得不到textarea值的解决方法----摘至天涯

倾然丶 夕夏残阳落幕 提交于 2020-01-20 20:00:21
以前有朋友遇到过这个问题,就是KindEditor在火狐下或者其他浏览器下都无法得到textarea文本框的值,点击表单提交按钮得到的是空白。昨天天涯PHP博客[http://blog.phpha.com]也无意遇到这个问题,于是想认真找下原因。 首先描述下我这边KindEditor的错误现象: 1、在IE8/FF下均得不到值; 2、当点击KindEditor的全拼按钮切换到全屏模式输入时,再返回正常模式,可以得到值; 3、我用的是jQuery的点击事件提交表单的, 提交 ,无法得到值; 4、直接用表单的提交按钮可以得到值。 下面以 KindEditor 4.x 版本为例说明,先贴上正确的代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <script type = "text/javascript" > //天涯PHP博客 http://blog.phpha.com KindEditor . ready ( function ( K ) { K . create ( 'textarea[name="content"]' , { themeType : 'simple' , resizeType : 1 , uploadJson : 'common/KEditor/upload_json.php' , fileManagerJson :