Copy link to clipboard
Copied
So I'm doing a search box with a submit button
I'd like it to be intuitive by having the words "search..." inside it by default
how do I make "search..." disappear when the user clicks on the box ?
is there any preference to post or get ?
Copy link to clipboard
Copied
Your question is not clear.
However, the post vs get question is clear. I prefer to post my forms because I don't want form variables in the address bar. This is especially true when the form contains a textarea and the data has carraige returns.
Copy link to clipboard
Copied
If it's a search box though, making it a get probably makes sense: it doesn't change the system so it's not really a POST sort of operation, plus the punter can bookmark the search (results) URL which is quite handy.
Google uses a GET, for example.
But there's no hard-and-fast rule, obviously
.
As for the original question: this is really a client-side question, not a CF question (despite using <cfinput>). As someone else suggested, read up on HTML and probably the JavaScript event model.
--
Adam
Copy link to clipboard
Copied
You can use Javascript to do that. I searched Google for "html search box default text" and found quite a few examples.