[WEB4LIB] Re: HTML question: Using images as buttons on forms

Thomas Dowling tdowling at ohiolink.edu
Tue Dec 19 11:28:44 EST 2000


----- Original Message -----
From: "Araby Greene" <araby at unr.edu>
To: "Multiple recipients of list" <web4lib at webjunction.org>
Sent: Tuesday, December 19, 2000 10:43 AM
Subject: [WEB4LIB] Re: HTML question: Using images as buttons on forms


> Since the default behavior for image type input is to "submit" you have
to
> use JavaScript to call a function that resets the form "onClick."
>
> This article has a script that accounts for several anomalies:
> http://tech.irt.org/articles/js185/
> A simpler example is at: http://www.easyjavascript.com/submitreset.htm
>

<gripe topic="accessibility" type="stock">

Bear in mind that a Javascriptless user will continue to submit the form
when clicking on the "reset" image input.  Note that both of these
examples ultimately turn both submit and reset inputs into either <a
href="javascript:..."> or <a href="" onClick="...">.  In both of these
cases, the form becomes completely unusable for a user who disables
Javascript.

</gripe>

Personally, I like form widgets that look the same as in every other
program I use on my PC; that's why modern operating systems have
system-wide widget toolkits.  When I see an honest-to-god button, I
immediately know what it is.  If you're compelled to using images rather
than system defaults, though, here's an accessible alternative: use
javascript itself to write out the javascript links
above--document.write('<a href="javascript...">');--and put the "real"
submit and reset buttons in a NOSCRIPT element.

Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu



More information about the Web4lib mailing list