Re: suggestion box, has text and text goes when you click in the box,
how?That's how I do it, Jon, and in fact, I add a bit so that if the field
is blurred with a value of "" its value is reset to the original -
<input type="text" name="n" value="Your message"
onFocus="if(this.value==this.defaultValue)this.value=''"
onBlur="if(this.value=='')this.value=this.defaultValue>
--
Murray
Jens,
That's the wrong way around also the syntax is off - basically it's
saying if the value is NOT "Please enter text here" clear the box - so the
user would never be able to type anything

This is how to do it -
there's no need for a function call
<input type="text" value="Enter Text Here"
onfocus="if(this.value==this.defaultValue)this.value='';">
We only clear the box when the value IS the default value "Enter Text
Here"
--
Cheers,
Jon
Microsoft MVP
The first part is easy, just specify the value in properties for the form
field.
The second requires some JavaScript. Something like this:
function clearIt(){
if (form[0].formfieldname.value != "Please enter text here"){
form[0].formfieldname.value = ""
}
}
And then you add an onClick action to the form field that calls the
function.
Notice that "formfieldname" should be the real name assigned to the form
field in question.
Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
-----Original Message-----
From: thanks for the help mate [mailto:123]
Posted At: 13. februar 2005 19:01
Posted To: microsoft.public.frontpage.programming
Conversation: suggestion box, has text and text goes when you
click in the box, how?
Subject: suggestion box, has text and text goes when you
click in the box, how?
I have a suggestion box and want to have 'please enter text
here' in the box and have that text go when they click in the box.
how do I do this?
thank you
J
using FrontPage