In article <op**************@news-text.blueyonder.co.uk>, Michael
Winter <M.******@blueyonder.co.invalid> wrote:
On Sun, 18 Apr 2004 19:56:01 -0700, Dennis M. Marks
<de******@domain.invalid> wrote:
On my web site, indicated below, go to the yearly calendar page. Upon
entry it shows the current year. The arrows at the top make it go
forward and backward. If you put a date into the little box and click
outside the box it creates that year. If you put a date in the box and
press return the calendar is drawn and then the page immediately
reloads. Why?
The others have indicated why, but have given unnecessarily complicated
solutions. Simply remove the FORM element. You don't use it, and it's
invalid mark-up, too. FORM elements are only required to submit values[1],
not to contain form controls.
Mike
[1] You could also use them for ease of reference, rather than relying on
getElementById(), and the like.
Thanks for all the advice. The best method was as follows:
<form onsubmit="return false">
Enter year and click create <input type="text" size="5" maxlength="4"
onchange="y=this.value; initPage()" />
<input type="submit" value="create"/ >
</form>
The submit button doesn't really do anything but it gives a place to
click outside the box.
--
Dennis M. Marks
http://www.dcs-chico.com/~denmarks/
Replace domain.invalid with dcsi.net
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----