473,791 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making default entry in search text box disappear on click

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

Jul 24 '05
36 72092
On Wed, 6 Jul 2005, Philip Ronan wrote:

[I'm reinstating the relevant context:]
Perhaps you're confusing "Javascript " with "Java"? "Alan J. Flavell" wrote:
You're very rude.
I'm sorry you think that way. I'm not *trying* to be rude. I'm just trying
to understand your point of view. I'm still confused.

You joined this thread by remarking that
What's insecure is allowing an untrusted site to execute javascript on
one's browser. The intended purpose is irrelevant for this. If you
don't yet know this, then you aren't in a position to argue about it.


Then you "clarified" your position by stating that
I'm saying that the design should never
*rely* on javascript being successfully executed. Using it to provide
optional extra conveniences is perfectly fine.


Those viewpoints just aren't consistent.


The inconsistency is only in your own mind. If you'd been paying
attention to any serious discussion on these principles, you wouldn't
be making such a silly claim.
If you check back through this thread, I think you'll find that my
suggested solution to the OP's problem doesn't *rely* on the
availability of Javascript, because the initial text can easily be
deleted by other means.


Then why are you raising this silly argument, if you already know that
one should not *rely* on javascript being available, and think you can
do it compatibly?

I conclude that your answer to my point was essentially "yes, I agree
with what you say, and if you read the detail of my earlier posting
you'll see that I'm already doing it that way, although I omitted to
say it in so many words".

It remains then only to discuss whether there's any point in
filling-in a default submission value, what that value could usefully
be, and how inconvenient it might or might not be for users to delete
it. But those detailed points are already being discussed by others
and I don't care to get involved in them. It was the more basic
principle that I felt I needed to dispute.

(Benjamin Niemann has calmly posted a solution which is compatible
with the principles which I'm promoting.)

all the best
Jul 24 '05 #21
"Jukka K. Korpela" wrote:
Philip Ronan <in*****@invali d.invalid> wrote:
Meanings. OK then. In your last post you said that using "Search"
as initial text is "... simply wrong because it's defined as
default text". So where *is* this definition?


In the HTML specification, as I explained. Did you already forget to
look for meanings, not words?


Then please take your own advice. Your argument has no basis other than a
bogus assertion based on your own biased judgement.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 24 '05 #22
"Alan J. Flavell" wrote:
The inconsistency is only in your own mind. If you'd been paying
attention to any serious discussion on these principles, you wouldn't
be making such a silly claim.
Alan, earlier today you responded to my suggestion about using Javascript to
clear the initial contents of a search box as follows:
What's insecure is allowing an untrusted site to execute javascript on
one's browser. The intended purpose is irrelevant for this. If you
don't yet know this, then you aren't in a position to argue about it.
If you can't see the inconsistency between that statement and your
subsequent assertion that using Javascript to provide "extra conveniences"
is "fine" then frankly there's not much point in me trying to continue a
logical discussion here.
Then why are you raising this silly argument, if you already know that
one should not *rely* on javascript being available, and think you can
do it compatibly?
Please look back through this thread and check who said what. All I did was
propose a solution to the OP's question. Since then I've been dodging
brickbats from you and Jukka. I'm not the one raising silly arguments.
It remains then only to discuss whether there's any point in
filling-in a default submission value, what that value could usefully
be, and how inconvenient it might or might not be for users to delete
it.
In a nutshell, that's what this whole thread has been about.
But those detailed points are already being discussed by others
and I don't care to get involved in them. It was the more basic
principle that I felt I needed to dispute.


I see. So when you made your caustic remark about my suggestion to use
Javascript to clear the initial contents of a search box, you were *in fact*
making a general comment about the "basic principles" of Javascript? Perhaps
a better place for such comments would be in a thread where people are
discussing the basic principles of Javascript, and not its specific use as a
means of clearing the contents of a search box. Just to avoid confusion...

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 24 '05 #23
"Darin McGrew" wrote:
Philip Ronan <in*****@invali d.invalid> wrote:
You can also omit the submit button altogether. The form can still be
submitted without it.


Well, yes. And windows can still be scrolled even when the author removes
the scrollbars.

But it doesn't seem very user-friendly to remove the most obvious and most
familiar mechanisms for submitting a form or scrolling a window.


Don't know about you, but I normally use the return key to submit
single-line forms.

Take a look at <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.8>.
In the suggested replacement for the (deprecated) ISINDEX element, you'll
see a form with no submit button. There are no accessibility or
user-friendliness issues with this technique that I am aware of.

Incidentally, how do you scroll windows when there are no scroll bars?

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 24 '05 #24
Philip Ronan <in*****@invali d.invalid> wrote:
You can also omit the submit button altogether. The form can still be
submitted without it.

I wrote: Well, yes. And windows can still be scrolled even when the author removes
the scrollbars.

But it doesn't seem very user-friendly to remove the most obvious and most
familiar mechanisms for submitting a form or scrolling a window.

Philip Ronan <in*****@invali d.invalid> wrote: Don't know about you, but I normally use the return key to submit
single-line forms.
So do I. But I wouldn't try to hide the submit button from those who
normally use it.

I normally use shift-click and ctrl-shift-click to open links in new
windows. But I wouldn't try to hide the context menu from those who
normally use it.

I normally use ctrl-P to print web pages. But I wouldn't try to hide the
File > Print... menu from those who normally use it.

And so on.
Take a look at <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.8>.
In the suggested replacement for the (deprecated) ISINDEX element, you'll
see a form with no submit button. There are no accessibility or
user-friendliness issues with this technique that I am aware of.
The purpose of that example is to demonstrate a form that replicates the
deprecated ISINDEX element. If you add a submit button, then you've added
something beyond what ISINDEX provides, and the example is less clear.

Are there any other W3C example forms that omit the submit button?
Incidentally, how do you scroll windows when there are no scroll bars?


I generally use the keyboard (page up, page down, home, end, and arrows,
possibly modified by ctrl/shift). Mouse gestures work, too, for those so
inclined.
--
Darin McGrew, mc****@stanford alumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp. com, http://www.HTMLHelp.com/

"When strong encryption is outlawed, only outlaws jvyy hfr fgebat rapelcgvba."
Jul 24 '05 #25
Philip Ronan <in*****@invali d.invalid> wrote:
Don't know about you, but I normally use the return key to submit
single-line forms.

Take a look at <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.8>.
In the suggested replacement for the (deprecated) ISINDEX element, you'll
see a form with no submit button. There are no accessibility or
user-friendliness issues with this technique that I am aware of.


A user behaviour study [1] that I helped to set up and conduct clearly
showed that most users are lost when there is no submit button. Even
amongst computer literate under 35's the percentage was quite high.

[1] Internal company use only, results are not public.

--
Spartanicus
Jul 24 '05 #26
"Darin McGrew" wrote:
Take a look at <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.8>.
In the suggested replacement for the (deprecated) ISINDEX element, you'll
see a form with no submit button. There are no accessibility or
user-friendliness issues with this technique that I am aware of.
The purpose of that example is to demonstrate a form that replicates the
deprecated ISINDEX element.


Yes indeed it is.
If you add a submit button, then you've added
something beyond what ISINDEX provides, and the example is less clear.


Pardon?

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 24 '05 #27
"Spartanicu s" wrote:
A user behaviour study [1] that I helped to set up and conduct clearly
showed that most users are lost when there is no submit button. Even
amongst computer literate under 35's the percentage was quite high.


Fair enough. But if we're talking about a search box that appears on every
page of a website I'm sure people will soon figure out what it's for. Did
the buttonless search box in your study have any initial content?

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 24 '05 #28
On Wed, 6 Jul 2005, Philip Ronan wrote:
"Alan J. Flavell" wrote:
The inconsistency is only in your own mind. If you'd been paying
attention to any serious discussion on these principles, you wouldn't
be making such a silly claim.
Alan, earlier today you responded to my suggestion about using Javascript to
clear the initial contents of a search box as follows:
What's insecure is allowing an untrusted site to execute javascript on
one's browser. The intended purpose is irrelevant for this. If you
don't yet know this, then you aren't in a position to argue about it.


If you can't see the inconsistency between that statement and your
subsequent assertion that using Javascript to provide "extra conveniences"
is "fine"


I've already pointed you to resources which I'd say will confirm that
my advice is consistent with the general conclusions of informed
discussion here and in other relevant forums. If you're still
resistant to those then I see little point in arguing with you further
on a one to one basis.
then frankly there's not much point in me trying to continue a
logical discussion here.


Indeed.

bye

Jul 24 '05 #29
Philip Ronan <in*****@invali d.invalid> wrote:
Take a look at <http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.8>.
In the suggested replacement for the (deprecated) ISINDEX element, you'll
see a form with no submit button. There are no accessibility or
user-friendliness issues with this technique that I am aware of.

I wrote: The purpose of that example is to demonstrate a form that replicates the
deprecated ISINDEX element.
Philip Ronan <in*****@invali d.invalid> wrote:
Yes indeed it is. If you add a submit button, then you've added
something beyond what ISINDEX provides, and the example is less clear.

Pardon?


The example in the HTML 4 spec is not--nor was it intended to be--a good
example of an HTML form. It was intended to be an example of an HTML form
that replicates the deprecated ISINDEX functionality. Since ISINDEX doesn't
generate a submit button, the example form has no submit button.

If the example had included a submit button, then it would have been a
better example of a good HTML form. However, it would have been a worse
example of a form that merely replicates the deprecated ISINDEX
functionality.

Other forms shown in the HTML 4 spec, which are intended to be good
examples of an HTML form, do include submit buttons.
--
Darin McGrew, mc****@stanford alumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp. com, http://www.HTMLHelp.com/

"When strong encryption is outlawed, only outlaws jvyy hfr fgebat rapelcgvba."
Jul 24 '05 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3169
by: shantibhushan | last post by:
Hi buddy I have to highlight search text from search results as it is in google or alibaba.com. e.g. if I input paper as a searchtext in search results paper word should be highlighted. as it isin google help. some one help me please. I am working in asp.net2.0 using c# Regards,
0
957
by: Ivica Muruzovic | last post by:
How can I use previous typed search text in google search box or any other web browser. I have combobox and want to fill him with that previous typed search text on local machine
4
6843
by: sangam56 | last post by:
Hi all. I have an iframe in an asp.net web page (Display.aspx). <iframe id="iframe1" runat="server" src="temp/test.html"></iframe> Now I need to highlight a search text, say 'test' in the Display.aspx page. The source of iframe is dynamically assigned and search text is also changeable. This means I am dealing with dynamic search text and html page. Please suggest me how could I highlight the search texts in the iframe placed in the...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.