> Given the following example, I want "Jane Doe" to appear
> when the user first views the form, and when he leaves it blank:
[quoted text clipped - 27 lines]
> The address is phony to prevent spam, etc.
> Thank you for understanding.
007 -
Well, one way or another, you'll be using a function for
this...probably meant a separately declared (global) function.
Could you elaborate on this?
> I want "Jane Doe" to appear when the user first
> views the form, and when he leaves it blank:
James Bond 007 - 29 Apr 2005 23:28 GMT
>> Given the following example, I want "Jane Doe" to appear
>> when the user first views the form, and when he leaves it blank:
[quoted text clipped - 23 lines]
>> -----
>> Bond . . . James Bond
>007 -
>
>Well, one way or another, you'll be using a function for
>this...probably meant a separately declared (global) function.
>
>Could you elaborate on this?
I came up with the following,
but it doesn't re-fill the default value
if the user leaves the box blank
(the Reset function does that,
but I don't want the user to have to do that):
// (purposely omitted stuff)
// if field is blank, then show alert
function formCheck() {
if (document.myform.name.value=="") }
alert("Please fill-in ALL the boxes!");
return false;
}
// (purposely omitted stuff)
// call formCheck (above) when user hits "Submit" button
<FORM NAME="myform" METHOD="POST" ACTION="(cgi)"
onSubmit="return formCheck()">
// (purposely omitted stuff)
<INPUT NAME="name" TYPE="text" MAXLENGTH="35" SIZE="35"
required="YES" VALUE="Jane Doe">
I'm thinking that just after the "VALUE" part, in the above line,
there should be something like this:
onExitFromField="(if value is blank then 'alert' and reset to
"Jane Doe")"
Now, if someone could tell me what the above line
should *really* look like . . . !!!
Thanks!
-----
Bond . . . James Bond
Do not reply via e-mail.
The address is phony to prevent spam, etc.
Thank you for understanding.
Mick White - 30 Apr 2005 02:17 GMT
[snip]
> <INPUT NAME="name" TYPE="text" MAXLENGTH="35" SIZE="35"
> required="YES" VALUE="Jane Doe">
[quoted text clipped - 4 lines]
> onExitFromField="(if value is blank then 'alert' and reset to
> "Jane Doe")"
http://www.apptools.com/examples/dynamiceventhandler.php
Mick