Add a date clearing button beside calendar
2005/03/21 06:49
Viewed 15963 times
Replies: 1/1

Add the following to your form:

<input type=button value="Clear Date" onClick="document.forms.fieldname.value=''"></div>

Several things should be pointed out for those less familiar to javascript:
1) Your form obviously has to be named; in the above case the form would have a name value of "forms" (<form method="POST" name="forms" action="postpage.htm">)
2) "fieldname" is the name of your date input field
3) the value should look like this, but without any spaces: onClick="document.forms.fieldname.value=' ' ">
- So the value following the equal sign is two single-quotes followed by a double-quote -- no spaces between any of them. I wrote it out this way, because it's difficult to tell the difference between single and double quotes on this forum.

Now you should be able to make your input field read-only, while still giving the user to clear the date out entirely by passing an empty value via the about onclick command. It's a stop-gap approach, at least until the dev team adds it directly to the calendar. ;-)

Badly written last two sentences
2005/03/21 06:55
Viewed 18622 times
Replies: 0/0

The last two sentences should read:

Now you should be able to make your input field read-only (if so desired to enforce formatting), while still giving the user the ability to clear the date field entirely by passing an empty value via the button's onclick command. It's a stop-gap approach, at least until the dev team adds a similar button directly to the calendar. ;-)

last
Google