Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Solution to the HTML Submit problem. (was: HTML experts ...)



I now have an elegant almost-complete solution to the problem
of HTML forms being prematurely submitted when Enter is pressed in a 
TEXT field. The solution involves JavaScript (as expected), but the 
form continues to work in the usual way if JavaScript is disabled.

The JavaScript solution involves disabling onSubmit and then forcing it
to happen with a special JavaScript button. A bit of trickery makes the
traditional "Submit" button become visible if JavaScript is disabled.

It's implemented in the form at:
http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwnewword.cgi

The key JavaScript is at the top of the page, and the Submit buttons
at the bottom (you'll be able to see why only one is visible.)

Thanks for the suggestions and comments.

Cheers

Jim

-- 
Jim Breen                                http://www.csse.monash.edu.au/~jwb/
Clayton School of Information Technology,               Tel: +61 3 9905 9554
Monash University, VIC 3800, Australia                  Fax: +61 3 9905 5146
(Monash Provider No. 00008C)                ジム・ブリーン@モナシュ大蛙触Â


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links