单击时,搜索文本框中的默认条目将消失 [英] Making default entry in search text box disappear on click
问题描述
大家好
我如何做到这一点,以便当用户点击搜索文本字段时,
默认条目(在这种情况下为 ;搜索)自动删除 - 他们
然后面对一个空白的搜索框,可以直接打字
提前谢谢
" spence"写道:
大家好
我如何做到这一点,以便当用户点击搜索文本字段时,
默认条目(在这个案例搜索会自动删除 - 然后他们会面对一个空白的搜索框,可以直接打字
提前致谢
< INPUT type =" text"值= [搜寻" onfocus =" if
(this.value == this.defaultValue)this.value ='''';">
-
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
很棒。谢谢菲利普。
我试过搜索其他团体但却找不到东西!也许它
是我的搜索条件?无论如何,如果有人使用我正在使用的相同的
搜索条件,它就在这里!
再次感谢
"斯宾塞"其中p是*********** @ gmail.com>写道:
很棒。
真的吗?你的答案错了。这就是你通常在错误的群体中询问
所得到的。动态修改字段的内容不是一个HTML问题。
我尝试搜索其他组但却找不到东西!也许它是我的搜索标准?无论如何,如果有人使用我正在使用的相同
搜索条件,它就在这里!
好吧,也许我需要提一下答案这是错误的。
这是错误的,因为它依赖于浏览器中的安全漏洞(如果浏览器禁用了客户端脚本,它确实无法工作),做什么
根本不需要做的事情。只有当初始内容是_meaningful且有用时,搜索框才应该有
的初始内容
default_。把它擦掉是荒谬的。
-
Yucca, http://www.cs.tut.fi/~jkorpela/
有关网页制作的网页: http://www.cs.tut.fi/~jkorpela/www。 HTML
Hi All
How do I make it so that when a user clicks in a search text field, the
default entry (in this case "Search") is removed automatically - they
are then faced with a blank search box and can type straight away
Thanks in advance
"spence" wrote:
Hi All
How do I make it so that when a user clicks in a search text field, the
default entry (in this case "Search") is removed automatically - they
are then faced with a blank search box and can type straight away
Thanks in advance
<INPUT type="text" value="Search" onfocus="if
(this.value==this.defaultValue) this.value='''';">
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Brilliant. Thanks philip.
I tried searching other groups but couldn''t find a thing! Perhaps it
was my search criteria? Anyway, it''s here now if anyone uses the same
search criteria I was using!
Thanks again
"spence" <be***********@gmail.com> wrote:
Brilliant.
Really? You got a wrong answer. That''s what you usually get by asking
in a wrong group. Dynamic modification of a field''s content is not an
HTML matter.
I tried searching other groups but couldn''t find a thing! Perhaps it
was my search criteria? Anyway, it''s here now if anyone uses the same
search criteria I was using!
Well, maybe I then need to mention that the answer is wrong.
It is wrong because it relies on security holes in browsers (it does
not work if the browser has client-side scripting disabled), for doing
something that need not be done at all. A search box should have
initial content only if the initial content is a _meaningful and useful
default_. It would then be absurd to wipe it out.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
这篇关于单击时,搜索文本框中的默认条目将消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!