textarea

Implementing a resizable textarea?

℡╲_俬逩灬. 提交于 2019-11-28 03:24:15
How does Stackoverflow implement the resizable textarea? Is that something they rolled themselves or is it a publicly available component that I can easily attach to textareas on my sites? I found this question and it doesn't quite do what I want. autosizing-textarea That talks more about automatically resizing textareas whereas I want the little grab-area that you can drag up and down. Shog9 StackOverflow uses a jQuery plugin to accomplish this: TextAreaResizer . It's easy enough to verify this - just pull the JS files from the site. Historical note: when this answer was originally written,

HTML5/CSS3 - Change the look of resize handles

旧时模样 提交于 2019-11-28 03:21:17
问题 I don't want to turn off resizing completely, but the resize handles on textareas don't fit with the rest of the page style. Is there a way I can change how it looks, perhaps replacing it with an image of my own? There doesn't have to be backward compatibility for browsers that don't support HTML5. 回答1: This is a tough one. There is no way of styling this specific control. Even if you force a different appearance under webkit you still get the damn resize handle: http://jsfiddle.net/qw73n/

Limiting number of lines and letters in single line in textarea

末鹿安然 提交于 2019-11-28 01:32:54
问题 Problem: I am trying to limit number of lines AND letters in each line in a textbox. What i got so far: So far i managed to limit lines count using this: var text = $(this).val(); var lines = text.split("\n"); if(e.keyCode == 13 && lines.length >= $(this).attr('rows')) { return false; } This won't allow user to push return key (keyCode 13) if the limit of lines is reached. The problem: Now i am trying to limit number of letters in a single line too, because if i reach end of my textarea (with

How to add an inline image to the end of a string in a TextArea in JavaFX?

China☆狼群 提交于 2019-11-28 01:19:58
I am trying to add an emoji to my chat program when my client types :) I am trying to add this in the FXML controller. I have captured when the user types :) using the following code snippet : if(chat.contains(":)")) { ... } My chat is printed into a textarea named taChat taChat.appendText(chat + '\n'); Any help is appreciated! A better approach would be to use TextFlow instead of using TextArea. Advantages : Individual Text are treated as children to the TextFlow. They can be added and accessed individually. ImageView can be added directly to the TextFlow as a child. A simple chat window with

Asp.Net Form DefaultButton Error in Firefox

百般思念 提交于 2019-11-28 01:12:09
问题 The .Net generated code for a form with the "DefaultButton" attribute set contains poor javascript that allows the functionality to work in IE but not in other browsers (Firefox specifcially). Hitting enter key does submit the form with all browsers but Firefox cannot disregard the key press when it happens inside of a <textarea> control. The result is a multiline text area control that cannot be multiline in Firefox as the enter key submits the form instead of creating a new line. For more

Turning off auto-complete for textarea and inputfields in Android Cordova-app

两盒软妹~` 提交于 2019-11-28 01:11:14
I'm working on an Android app (2.3.3) using Cordova (1.9.0), html5, javascript. It's a language training tool so when users type their answers in textareas or inputfields, I don't want them to see suggestions. I've tried autocomplete="off" in the textarea and input tag as well as in the form tag, but neither work. Does anyone know how to turn these suggestions off? my test-html looks like this: <div><b>With form:</b> <form autocomplete="off"> <p>Wie <input size="5" value="b" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false"> jij?</p> <textarea spellcheck="false"

How to append text to '<textarea>'?

白昼怎懂夜的黑 提交于 2019-11-27 22:55:24
I have <textarea> where user can type in his message to the world! Below, there are upload buttons... I would love to add link to uploaded file (don't worry, I have it); right next to the text that he was typing in. Like, he types in 'Hello, world!', then uploads the file (its done via AJAX), and the link to that file is added in next line to the content of <textarea> . Attention! Is it possible to keep cursor (place where he left to type) in the same place? All that may be done with jQuery... Any ideas? I know that there are method 'append()', but it won't be for this situation, right? Try

Get value from text area [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-11-27 22:39:21
This question already has an answer here: how to get the value of a textarea in jquery? 11 answers How to get value from the textarea field when it's not equal "". I tried this code, but when I enter text into textarea the alert() isn't works. How to fix it? <textarea name="textarea" placeholder="Enter the text..."></textarea> $(document).ready(function () { if ($("textarea").value !== "") { alert($("textarea").value); } }); Use .val() to get value of textarea and use $.trim() to empty spaces. $(document).ready(function () { if ($.trim($("textarea").val()) != "") { alert($("textarea").val());

Force spell check on a textarea in WebKit

心已入冬 提交于 2019-11-27 22:27:55
I'm creating a browser based QC/data entry app that will let people edit OCRed files, which naturally have tons of errors. Chunks of data are put in textareas so they can be checked, but the red underlines only appear when the user manually puts the cursor in a misspelled word. Is there a way to force WebKit to add the little red spell check underlines to textareas? Essentially you need to use the selection api to move the insertion point over each word to get Safari to highlight it. Here's an example to scan over the first thousand words... textarea = document.getElementById("mytextarea");

Javascript detect scrollbar in textarea

陌路散爱 提交于 2019-11-27 21:20:51
I was wondering if anybody knows how I would go about detecting when the scrollbar appears inside a textarea . I am currently using mootools for my JavaScript and I am having issues getting it to detect a scrollbar. Tommaso Taruffi function has_scrollbar(elem_id) { const elem = document.getElementById(elem_id); if (elem.clientHeight < elem.scrollHeight) alert("The element has a vertical scrollbar!"); else alert("The element doesn't have a vertical scrollbar."); } See this jsFiddle http://jsfiddle.net/qKNXH/ Capt Otis Tommaso's solution works perfectly, even with a text area. But if the user