textarea的“必需”即使该值为空,属性也不起作用

编程入门 行业动态 更新时间:2024-10-09 21:19:27
本文介绍了textarea的“必需”即使该值为空,属性也不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

列表框工作正常,但textarea框没有说明

<!DOCTYPE html> < html> < head> < title>评分&评论和LT; /标题> < body> < form> < span>客户服务*< / span> < span> < select name = customer id = aa required> < option selected =ratevalue =disabled> rate< / option> < option value = 1> 1< / option> < option value = 2> 2< / option> < option value = 3> 3< / option> < option value = 4> 4< / option> < option value = 5> 5< / option> < / select> < / span> < br>< br> < span>物有所值*< / span> < span> < select name = money id = aa required> < option selected =ratevalue =disabled> rate< / option> < option value = 1> 1< / option> < option value = 2> 2< / option> < option value = 3> 3< / option> < option value = 4> 4< / option> < option value = 5> 5< / option> < / select> < / span> < div> < textarea name =reviewsrows = 11 cols = 50 maxlength = 250 required> < / textarea> < / div> < div id = submit> < br> < input type = submit name = submit value = submit> < / div> < / form> < / body> < / html>

解决方案

< textarea name =reviewsrows = 11 cols = 50 maxlength = 250 required>< / textarea>

I created a simple page with list box and text area with conditions that all should be required.

List box are working fine, but textarea box doesn't tell that the field is required to be filled.

<!DOCTYPE html> <html> <head> <title>Ratings & Reviews</title> <body> <form> <span>Customer Service*</span> <span> <select name=customer id=aa required> <option selected="rate" value="" disabled>rate</option> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> </select> </span> <br><br> <span>Value for money*</span> <span> <select name=money id=aa required> <option selected="rate" value="" disabled>rate</option> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> </select> </span> <div> <textarea name="reviews" rows=11 cols=50 maxlength=250 required> </textarea> </div> <div id=submit> <br> <input type=submit name=submit value=submit> </div> </form> </body> </html>

解决方案

You have empty space inside text area, remove it:

<textarea name="reviews" rows=11 cols=50 maxlength=250 required ></textarea>

更多推荐

textarea的“必需”即使该值为空,属性也不起作用

本文发布于:2023-10-26 06:53:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529401.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:也不   值为   使该   属性   textarea

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!