为什么我的textarea的占位符不显示? [英] Why isn't my textarea's placeholder showing up?

查看:83
本文介绍了为什么我的textarea的占位符不显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为所有表单元素使用了占位符,除了textarea之外,它们都显示在其中。刚刚在Safari浏览器中看过它,并且已经意识到我输入的type =number也没有显示占位符。



页面是 here ,您需要点击页面顶部的'book now'链接。

我的html:

 < form id =booking行动= 单workshops.php > 
< input type =textrequired =requiredplaceholder =name/>< br />
< input type =textrequired =requiredplaceholder =your phone number/>< br />
< input type =emailrequired =requiredplaceholder =email/>< br />
< input type =numberrequired =requiredplaceholder =你的聚会中有多少人/>< br />
< textarea rows =5cols =30placeholder =enter optional message>
< / textarea>< br />
< input type =buttonvalue =submit/>
< / form>


解决方案

 < textarea rows =5cols =30placeholder =enter optional message> 
< / textarea>< br />

应该是:

 < textarea rows =5cols =30placeholder =enter optional message>< / textarea>< br /> 


I am using placeholders for all my form elements and it's showing up in them all apart from the textarea. Just looked at it in safari now, and have realised that my input of type="number" isn't showing the placeholder either.

The page is here and you need to click the 'book now' link at the top of the page.

My html:

<form id="booking" action="single-workshops.php">
    <input type="text" required="required" placeholder="name"/><br />
    <input type="text" required="required" placeholder="your phone number"/><br />
    <input type="email" required="required" placeholder="email"/><br />
    <input type="number" required="required" placeholder="how many in your party" /><br />
    <textarea rows="5" cols="30" placeholder="enter optional message">
    </textarea><br />
    <input type="button" value="submit"/>
</form>

解决方案

Because you have something as text in your textarea with a linebreak in it.

<textarea rows="5" cols="30" placeholder="enter optional message">
        </textarea><br />

Should be:

<textarea rows="5" cols="30" placeholder="enter optional message"></textarea><br />

这篇关于为什么我的textarea的占位符不显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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