Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-30-2008, 06:18 AM   #1
Joachim Schrader
LQ Newbie
Registered: Sep 2008
Location: Fredrikstad, Norway
Distribution: Ubuntu
Posts: 10

Rep: Reputation: 9
form field hints

Most of the time form field hints is useful - like your email address "pop up" as a hint as you type, but on some fields you wouldn't like it to show.

Like in "confirm email-address". I guess I can avoid this by naming the input differently, but that's not a good solution in my case as the same form is used on many different pages (using php include).

How can I disable the form field hints using css or html/php? I would rather not use javascripts...
Old 09-30-2008, 10:29 AM   #2
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
This question would probably have been better asked in the programming part of the forum. but never mind, I'll try and help...

The easy answer:

<input .... autocomplete='off' ...>

The good news is that the autocomplete='off' attribute will do pretty much exactly what you're asking for.

The bad news is that it's a non-standard attribute. So if you use it, you can't claim that your site is standards-compliant, and you can't guarantee that it'll work in all browsers (as far as I'm aware, it does work in MSIE and Firefox, but I can't vouch for any others, and I can't vouch for it working in the future).

If that bad news makes it a non-starter, then the next best suggestion is to have php generate a unique name for the input field each time you display the form.

Hope that helps.

Simon C.
Old 09-30-2008, 04:38 PM   #3
Joachim Schrader
LQ Newbie
Registered: Sep 2008
Location: Fredrikstad, Norway
Distribution: Ubuntu
Posts: 10

Original Poster
Rep: Reputation: 9
Thanks, it was just the thing I was looking for!

Most people use MSIE or Firefox, so I'm happy :-)

I thought of generating uniqe names with php, but belived it had to be a shortcut using css or html.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: build query from form entry, then display results in the same form tonedeaf1969 Programming 4 06-22-2007 08:55 AM
one charater is missed from html form field value simon_qwl Programming 2 04-24-2007 09:19 AM
Editing Firefox form field history? ylikone Linux - Software 3 03-01-2007 05:47 PM
Exec CGI within a form field newuser455 General 0 09-12-2004 02:50 PM
form field in html to have permanent value meluser Programming 3 04-19-2003 03:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration