旧浏览器的真正占位符文本修复?
我想使用 jQuery 代码来模拟旧浏览器的占位符文本。我找到了一些非常适合的人选,而且工作效果很好。然而,一个问题是解决方案倾向于输入占位符文本作为单元格值(直到用户输入)。这意味着,如果提交 html 表单时任何字段均未更改,则占位符文本将像用户输入一样提交。
有没有 jQuery 占位符解决方案可以解决这个问题?
干杯
I would like to use jQuery code to simulate placeholder text for old browsers. I have found a number that are great candidates, and work well. However, one issue is that the solutions tend to input the placeholder text as the cell value (until user input). This means that if an html form is submitted with any fields unchanged, then the placeholder text is submitted as if it is user input.
Are there any jQuery placeholder solutions that solve this?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用 jquery 占位符。你应该尝试一下
https://github.com/prantor19/jquery-placeholder
I use jquery placeholder . U should try it
https://github.com/prantor19/jquery-placeholder
在发送表单之前检查占位符值是否存在并将其删除:
Check if placeholder value is present before form is send and remove it:
就在我的脑海中,像这个(jsfiddle)这样的东西怎么样?
Just off the top of my head, what about something like this (jsfiddle).