textarea

Turn off textarea resizing

不打扰是莪最后的温柔 提交于 2019-12-03 00:56:59
问题 I'm trying to turn off textarea resizing in my site; right now I'm using this method: .textarea { clear:left; min-width: 267px; max-width: 267px; min-height:150px; max-height:150px; } I know that my method is not correct and I'm searching for a better one in JavaScript. I'm a beginner, so the best solution for me will be HTML5 or jQuery. 回答1: Try this CSS to disable resizing The CSS to disable resizing for all textareas looks like this: textarea { resize: none; } You could instead just assign

Textarea doesn't show newline in IE

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Looks like IE ignores \r\n in text when the text is placed into a textarea. Here's how it looks in FF/Chrome/Opera: Paragraph1 sometext Paragraph2 othertext And in IE7/8: Paragraph1 sometextParagraph2 othertext I tried changing "new-line" css parameter with no luck. Any ideas what might be wrong? I use asp.net as back end, where I assign that text to the textarea, but I doubt it's relevant. UPDATE: Seems like it's asp.net that is rendering asp:TextArea differently for different browsers - for IE it seems to ignore newline characters. When I

Textarea height: 100%

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here's my fiddle: http://jsfiddle.net/e6kCH/15/ It may sound stupid, but I can't find a way to make the text area height equal to 100%. It works for the width, but not for height. I want the text area to resize depending of the window size...like it works in my fiddle for the width... Any ideas? 回答1: Height of an element is relative to its parent. Thus, if you want to make expand your element into the whole height of the viewport, you need to apply your CSS to html and body as well (the parent elements): html, body { height: 100%; } #textbox

textarea中输入字数的限制

匿名 (未验证) 提交于 2019-12-03 00:43:02
<textarea id="area" name="ss" placeholder="请输入文本内容" rows="10" cols="50" onkeydown=‘inputLimit(this,1,2000);‘ onkeyup=‘inputLimit(this,1,2000);‘></textarea> <script type="text/javascript"> /*字数限制*/ function inputLimit(field, type, maxlimit) { if (type == 1) { if (field.value.replace(/[^\x00-\xff]/g, "xx").length > maxlimit) { alert("输入字数已达上项"); var str = ""; var n = 0; var schar; for (var i = 0; schar = field.value.charAt(i); i++) { n += (schar.match(/[^\x00-\xff]/) != null ? 2 : 1); if (n > maxlimit) break; str += schar; } field.value = str; } } } </script>  注:onkeyup和onkeydown需要同时使用

JS算法

匿名 (未验证) 提交于 2019-12-03 00:39:02
JS算法 <%-- Created by IntelliJ IDEA. User: Administrator Date: 2018/6/27 Time: 11:43 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/html"> <head> <meta charset="UTF-8"> <title>大批量生成数组数据</title> <style> .BB{ width: 400px; height: 300px; position: absolute; left:400px; top: 1px; margin-left: 50px; /*margin-top: -150px;*/ /**/ } .DD{ width: 400px; height:300px; position: absolute; left: -40px; top:400px; margin-left: 50px; } .EE{ width: 400px; height: 300px;

微信小程序输入多行文本

匿名 (未验证) 提交于 2019-12-03 00:30:01
昨天把系分的项目又加了一点逻辑判断,比如已经下单的菜品不能减少,不能重复下单,应该先下单再支付等… 弄完购物车的逻辑之后,发现一直没有管备注那一块,于是输入了一下试试,结果发现不能换行…就非常丑陋 后来查阅相关资料发现,我用的wxml组件是 input ,只能 单行输入 ,如果要支持 多行输入 ,应该用 textarea 。 下面就来介绍一下 textarea : 属性名 类型 默认值 说明 最低版本 value String 输入框的内容 placeholder String 输入框为空时占位符 placeholder-style String 指定 placeholder 的样式 placeholder-class String textarea-placeholder 指定 placeholder 的样式类 disabled Boolean false 是否禁用 maxlength Number 140 最大输入长度,设置为 -1 的时候不限制最大长度 auto-focus Boolean false 自动聚焦,拉起键盘。 focus Boolean false 获取焦点 auto-height Boolean false 是否自动增高,设置auto-height时,style.height不生效 fixed Boolean false 如果 textarea 是在一个

wangEditor编辑器控件里textarea的id不要用content

匿名 (未验证) 提交于 2019-12-03 00:02:01
头引用 <script type = "text/javascript" src = "js/jquery-1.10.2.min.js" ></script> <script type = "text/javascript" src = "js/wangEditor.js" ></script> <script type = "text/javascript" src = "js/base.js" ></script> <script src = "https://cdn.bootcss.com/layer/1.8.5/layer.min.js" ></script> <link href = "https://cdn.bootcss.com/layer/1.8.5/skin/layer.css" rel = "stylesheet" > 出错症状 正确 <textarea id = "textarea" name = "content" style = " height : 300px ; max - height : 1000px ; " > 错误 <textarea id = "content" name = "content" style = " height : 300px ; max - height : 1000px ; " > 我也不懂为什么 来源:博客园 作者:

JSP-一个ckeditor实现

匿名 (未验证) 提交于 2019-12-02 23:42:01
版权声明:【北京Java青年】:456588754 https://blog.csdn.net/Amen_Wu/article/details/53457502 第一步:向WebContent下添加ckeditor插件文件夹 第二步: //js的src属性填写ckeditor文件夹下的ckeditor.js地址 <head> <script type="text/javascript" src="../ckeditor/ckeditor.js"></script> </head> //将textarea的class改为ckeditor <body> <textarea class="ckeditor" id="ncontent" name="ncontent" cols="70" rows="10"></textarea> </body> 第三步: 想要控制编辑器尺寸的话,可以在textarea外边添加input标签,设置input的style内的尺寸属性即可。 文章来源: https://blog.csdn.net/Amen_Wu/article/details/53457502

Cannot insert data in the database using option(textarea)

故事扮演 提交于 2019-12-02 23:40:55
问题 I got this code but it is not inserting the content of the option (textarea) into the database. connection.php <?php $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $db = "copy"; $conn = mysqli_connect($dbhost,$dbuser,$dbpass,$db); ?> submit.php <?php include 'connection.php'; $foodA = $_POST['foodA']; $foodB = $_POST['foodB']; $foodC = $_POST['foodC']; $foodD = $_POST['foodD']; $foodE = $_POST['foodE']; if(!$_POST['submit']) { echo "please fill out the form"; header('Location: select