textarea

HTML(9)表单

落花浮王杯 提交于 2019-11-26 18:01:52
一、表单   1.表单的作用   HTML 表单用于接收不同类型的用户输入,用户提交表单时向服务器传输数据,从而实现用户与Web服务器的交互。   2.表单的工作机制           3.表单定义(<form></form>标签)    HTML表单是一个包含表单元素的区域, 表单使用<form> 标签创建。表单能够包含 input 元素 ,比如文本字段、复选框、单选框、提交按钮等等。表单还可以包含 menus 、 textarea 、 fieldset 、 legend 和 label 元素 。注意,<form >元素是块级元素,其前后会产生折行。 1 <form action="reg.ashx" method="post"> 2 <!--表单元素在这里--> 3 </form>   3.表单属性    action:规定当提交表单时,向何处发送表单数据。action取值为:第一,一个URL(绝对URL/相对URL),一般指向服务器端一个程序,程序接收到表单提交过来的数据(即表单元素值)作相应处理。比如<form action="http://www.cnblogs.com/reg.ashx">,当用户提交这个表单时,服务器将执行网址"http://www.cnblogs.com/"上的名为"reg.ashx"的一般处理程序。第二,使用mailto协议的URL地址

How do I set textarea scroll bar to bottom as a default?

对着背影说爱祢 提交于 2019-11-26 17:58:32
问题 I have a textarea that is being dynamically reloaded as user input is being sent in. It refreshes itself every couple seconds. When the amount of text in this textarea exceeds the size of the textarea, a scroll bar appears. However the scroll bar isn't really usable because if you start scrolling down, a couple seconds later the textarea refreshes and brings the scroll bar right back up to the top. I want to set the scroll bar to by default show the bottom most text. Anyone have an idea of

Why isn't textarea an input[type=“textarea”]?

时光怂恿深爱的人放手 提交于 2019-11-26 17:58:29
问题 Why is there an element <textarea> instead of <input type="textarea"> ? 回答1: Maybe this is going a bit too far back but… Also, I’d like to suggest that multiline text fields have a different type (e.g. “textarea") than single-line fields ("text"), as they really are different types of things, and imply different issues (semantics) for client-side handling. – Marc Andreessen, 11 October 1993 回答2: So that its value can easily contain quotes and <> characters and respect whitespace and newlines.

HTML5 textarea placeholder not appearing

心不动则不痛 提交于 2019-11-26 17:54:34
问题 I cannot figure out what is wrong with my markup, but the placeholder for the text area will not appear. It seems as though it may be covered up with some blank spaces and tabs. When you focus on the text area and delete from where the cursor puts itself, then leave the text area, the proper placeholder then appears. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> </head> <body> <form action="message.php" method="post" id="message_form"

Most efficient way to log messages to JavaFX TextArea via threads with simple custom logging frameworks

天大地大妈咪最大 提交于 2019-11-26 17:47:07
I have a simple custom logging framework like this: package something; import javafx.scene.control.TextArea; public class MyLogger { public final TextArea textArea; private boolean verboseMode = false; private boolean debugMode = false; public MyLogger(final TextArea textArea) { this.textArea = textArea; } public MyLogger setVerboseMode(boolean value) { verboseMode = value; return this; } public MyLogger setDebugMode(boolean value) { debugMode = value; return this; } public boolean writeMessage(String msg) { textArea.appendText(msg); return true; } public boolean logMessage(String msg) {

How to get number of rows in <textarea > using JavaScript?

点点圈 提交于 2019-11-26 17:40:55
I have a <textarea> element. Can I use JavaScript to detect that there are (for example) 10 rows of text in it? Well I found a much simplier way to do this, but you'll need to set the line-height of the textarea in the CSS. I tried to read the line height inside the script ta.style.lineHeight but it doesn't seem to return a value. CSS #ta { width: 300px; line-height: 20px; } HTML <textarea id="ta">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque suscipit, nisl eget dapibus condimentum, ipsum felis condimentum nisi, eget luctus est tortor vitae nunc. Nam ornare dictum augue, non

JavaFX append text to TextArea throws Exception

假如想象 提交于 2019-11-26 17:24:15
问题 Answer : JavaFX append text to TextArea throws Exception I have a thread that calculates the size of a directory. I use walkFileTree for this. To get some info, I append the actuall file to a textarea. But when I have a lot of files (ex. > 300) I got Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException Here is the code: private void startScheduledExecutorService() { Thread dt = new Thread(new Runnable() { public void run() { try { taStatus.appendText(

How to count the number of lines in a JTextArea, including those caused by wrapping?

时间秒杀一切 提交于 2019-11-26 17:12:41
问题 I have a JTextArea for which I have set word-wrap and wrap-style-word to true. I want to "pack" the JTextArea to the minimum possible height given a specified width. To do this, I'm planning calculating the height of the font using... Font font = jTextArea.getFont(); FontMetrics fontMetrics = jTextArea.getFontMetrics(font); int lineHeight = fontMetrics.getAscent() + fontMetrics.getDescent(); ...and then multiply this by the number of lines used in the JTextArea. The problem is that JTextArea

AngularJS: How to resolve “Attempting to use an unsafe value in a safe context”?

别说谁变了你拦得住时间么 提交于 2019-11-26 16:58:27
问题 When I tried to show my data as a text-html, it displayed in HTML format but when I refreshed the page, I am getting this error: [$sce:unsafe] Attempting to use an unsafe value in a safe context. Here is my AngularJS code: data.attributes.task_name = $sce.trustAsHtml(data.attributes.task_name); HTML <span ng-bind-html="taskdata.attributes.task_name" data-html="true" title="{{reminder.attributes.message}}"></span> 回答1: From the Angular documentation: The value provided for use in a specific

How to place cursor at end of text in textarea when tabbed into [duplicate]

偶尔善良 提交于 2019-11-26 16:45:23
问题 This question already has an answer here : Closed 6 years ago . Possible Duplicate: Javascript: Move caret to last character I have a standard textarea with some text in it. I'm looking for a way to have the cursor automatically be placed at the end of the existing text so a user can simply start typing to add more text. This should happen whenever the textarea becomes active such as when a user tabs into it. Any ideas? 回答1: I've answered this before: Javascript: Move caret to last character