Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
402
Chapter 16 Using HTML Forms
VALUE="Add Item to Cart">
VALUE="Delete Item from Cart">
Figure 16 12 Submit buttons with user defined labels.
ONCLICK, ONDBLCLICK, ONFOCUS, and ONBLUR
These nonstandard attributes are used by JavaScript capable browsers
to associate JavaScript code with the button. The
ONCLICK
and
ONDBL
CLICK
code is executed when the button is pressed, the
ONFOCUS
code
when the button gets the input focus, and the
ONBLUR
code when the
button loses the focus. If the code attached to a button returns
false
,
the submission of the form is suppressed. HTML attributes are not case
sensitive, and these attributes are traditionally called
onClick
,
onD
blClick
,
onFocus
, and
onBlur
by JavaScript programmers.
HTML Element:
HTML Markup
Attributes:
NAME
,
VALUE
,
ONCLICK
,
ONDBLCLICK
,
ONFOCUS
,
ONBLUR
This alternative way of creating submit buttons, supported only by Internet
Explorer, lets you use arbitrary HTML markup for the content of the button.
This element lets you to have multiline button labels, button labels with font
changes, image buttons, and so forth. Listing 16.4 gives a few examples, with
results shown in Figure 16 13.
NAME, VALUE, ONCLICK, ONDBLCLICK, ONFOCUS, and
ONBLUR
These attributes are used in the same way as with
.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved