• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

need help clearing fields

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am doing the website for a girls grammar school where i am employed and in on alumni page i have a form created in dreamweaver where they can fill-in their details. i placed mock entries in the fields to give them inspiration of what to write, but would like this info to disappear as soon as the past pupil clicks within the field to make their entry. can someone tell me what code i need to insert. many thanks in advance.
here is a link to the page in question with the form http://www.girlsacademy.org.uk/pages/pastpupils.html
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is really a JavaScript question, so I've moved it to the HTML/JavaScript forum for you.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could inside the input tag put this:

on Click should be one word..
BUT it does not work in Netscape 4.x!!
/Rene
[ July 05, 2002: Message edited by: Rene Larsen ]
 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you need the "javascript:" prefix in an on click handler. The prefix is only used for attributes which would normally take a URL as a parameter like <a href='javascript:window.close()'>close this window</a>.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you are right...
It is hard to remember when you get old
/Rene
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Note I had to put a space in on click just for posting on this forum.You will need to emove the space from on click.

folded long lines
[ July 05, 2002: Message edited by: Frank Carver ]
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure about removing content - they might want to just correct something, not to retype everything. I think it will be more clear, if you will just select content of a field.
And instead of onclick you might want to use onfocus - this event happends in all browsers, and it also will occur, if user reached a field using Tab button.
so, it will be something like
<input onfocus="this.select()"
 
Geoff Bell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your help. the "clearField(this);" did what i was asking for. i will alter the code my hand for now, but will see if it is possible to do it from within dreamweaver. (sorry if i insulted any hand-coders, but i am one of those that rely of wysiwyg. LOL.)
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,
I sat down and typed up this script for you. It will remove the default text without removing the users input. It will make them happy is they typed in all the information.
I placed it on my site with an explaination about it. I thought this was a good topic to add to my scripts, thanks for the idea.
http://www10.brinkster.com/a1ien51/Scripts/RemoveDefaultText.htm
If you have any problems geting it to work, just post it here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic