本文介绍了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的“必需”即使该值为空,属性也不起作用
发布评论