避免textarea rows / cols错误? [英] avoid textarea rows/cols error?

查看:130
本文介绍了避免textarea rows / cols错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了几页验证工具我遇到的一个问题是他们告诉我textarea必须有行和cols属性。如果我在CSS中设置或使用display:none(并使用它来保存原始文本数据),我可以做些什么跳过?它似乎是唯一的答案是rows =0cols =0,每次我使用它。但我觉得这不是一个好的解决方案。 停止使用 textarea 。如果你想要一些东西来保存原始数据,那么使用< script> 元素(如果你打算通过JS访问它)或者 / code>类型隐藏(如果您打算将其作为表单数据提交)。



Don如果您不打算让用户输入数据,请使用让用户输入数据的语义。


I am using a few page validation tools one problem i have is they tell me textarea must have rows and cols attribute. If i am setting this in CSS or using display:none (and using it to hold raw text data) can i do something to skip? it seems like the only answer is rows="0" cols="0" each time i use it. But i have a feeling that is not a good solution.

解决方案

Stop using a textarea. If you want something to hold raw data, then use a <script> element (if you plan to access it with JS) or an input of type hidden (if you plan to submit it as form data).

Don't use semantics that say "Let the user enter data" if you don't plan to let the user enter data.

这篇关于避免textarea rows / cols错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆