textarea

Autocomplete functionality on a textarea [closed]

夙愿已清 提交于 2019-11-26 19:50:24
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Is there a way to implement auto-complete functionality in a region defined by textarea tags or something similar? I'm currently using a jQuery auto-complete plugin to suggest input to the user inside input tags,

Height of textarea does not match the rows in Firefox

故事扮演 提交于 2019-11-26 19:45:19
问题 The textarea's rows attribute does not match the number of lines in Firefox. For instance: <textarea rows=4 cols=40> 1 2 3 4 this line is visible in FF </textarea> Example: http://jsfiddle.net/Z7zXs/6/ How can I fix this issue? The textarea should only display 4 lines (instead of 5) for rows=4 . 回答1: Firefox always adds an extra line after the textfield. If you want it to have a constant height, use CSS, e.g.: textarea { height: 5em; } http://jsfiddle.net/Z7zXs/7/ EDIT: You can also use the @

Can you have multiline HTML5 placeholder text in a <textarea>?

非 Y 不嫁゛ 提交于 2019-11-26 19:37:34
I have ghost text in textfields that disappear when you focus on them using HTML5's placeholder attribute: <input type="text" name="email" placeholder="Enter email"/> I want to use that same mechanism to have multiline placeholder text in a textarea, maybe something like this: <textarea name="story" placeholder="Enter story\n next line\n more"></textarea> But those \n s show up in the text and don't cause newlines... Is there a way to have a multiline placeholder? UPDATE : The only way I got this to work was utilizing the jQuery Watermark plugin , which accepts HTML in the placeholder text: $(

Why is textarea filled with mysterious white spaces?

馋奶兔 提交于 2019-11-26 19:29:53
I have a simple text area in a form like this: <textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink"> <?php if($siteLink_val) echo $siteLink_val; ?> </textarea> I keep getting extra white space in this textarea . When I tab into it my cursor is like in the middle of the textarea and not in the beginning? What is the explanation? Look closely at your code. In it, there are already three line breaks, and a ton of white space before </textarea> . Remove those first so that there are no line breaks in between the tags any more. It might already do the trick. Well,

How can you move the cursor to the last position of a textarea in Javascript?

家住魔仙堡 提交于 2019-11-26 19:24:15
问题 I have a textarea and a button on a form. The textarea may already have some text in it. I would like the cursor to move to the last position in the text area when the button is clicked. Is this possible? 回答1: By “the last position”, do you mean the end of the text? Changing the ‘.value’ of a form field will move the cursor to the end in every browser except IE. With IE you have to get your hands dirty and deliberately manipulate the selection, using non-standard interfaces: if (browserIsIE)

How do I make a textarea an ACE editor?

佐手、 提交于 2019-11-26 18:47:38
问题 I'd like to be able to convert specific textareas on a page to be ACE editors. Does anyone have any pointers please? EDIT: I have the the editor.html file working with one textarea, but as soon as I add a second, the second isn't converted to an editor. EDIT 2: I decided to scrap the idea of having several, and instead open one up in a new window. My new predicament is that when I hide() and show() the textarea, the display goes awry. Any ideas? 回答1: As far as I understood the idea of Ace,

textarea character limit

扶醉桌前 提交于 2019-11-26 18:46:03
I would like to be able to limit the number of characters in a textarea. The method I am using works great in Google Chrome, but is slow in Firefox, and doesn't work in IE. Javascript: function len(){ t_v=textarea.value; if(t_v.length>180){ long_post_container.innerHTML=long_post; post_button.className=post_button.className.replace('post_it_regular','post_it_disabled'); post_button.disabled=true; } else{ long_post_container.innerHTML=""; post_button.className=post_button.className.replace('post_it_disabled','post_it_regular'); post_button.disabled=false; } if(t_v.length>186){ t_v=t_v.substring

Java Swing GUI Client and Server Chat App TextArea not updating

人走茶凉 提交于 2019-11-26 18:39:22
问题 I am doing a Chat Application using Java and Swing class for GUI. The ChatServer class will be the server receiving message from clients and echo back to all clients but I only intend to make the chat for 2 clients. The ChatClient class is both of the client. They display what was sent from the server on the Text Area. And send texts in the Text Field to the server. ChatClient Class package chatclient; import java.net.Socket; import java.io.BufferedReader; import java.io.DataInputStream;

Should I size a textarea with CSS width / height or HTML cols / rows attributes?

坚强是说给别人听的谎言 提交于 2019-11-26 18:17:47
Every time I develop a new form that includes a textarea I have the following dilemma when I need to specify its dimensions: Use CSS or use the textarea 's attributes cols and rows ? What are the pros and cons of each method? What are the semantics of using these attributes? How is it usually done? kogakure I recommend to use both. Rows and cols are required and useful if the client does not support CSS. But as a designer I overwrite them to get exactly the size I wish. The recommended way to do it is via an external stylesheet e.g. textarea { width: 300px; height: 150px; } <textarea> <

Set textarea width to 100% in bootstrap modal

我们两清 提交于 2019-11-26 18:17:08
问题 Was trying all possible ways, but never succeeded: <div style="float: right"> <button type="button" value="Decline" class="btn btn-danger" data-toggle="modal" data-target="#declineModal">Decline</button> </div> <!-- Modal --> <div class="modal fade" id="declineModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria