Form element – input type=”image”

The form can be submitted to server by standard button input type=”submit”, or by help of pictorial element input type=”image”. If you want to have the same look and feel of submit buttons across all browsers and systems, it is necessary to use the form element image. Disadvantage of the image element is the lack of animation when clicked, so it does not always looks like a real button.


Special type of information is sent when form is submitted by element image as you can see at form test. All browsers submit the coordinates x, y of point where the click occurred. Browsers FireFox, Chrome and Safari submit also the pair name=value (here image=clicked) and so simulate the element submit. In the second element (imageButton) there is no value specified (this is optional attribute) and therefore no pair of name=value is submitted.

When there are more image elements in the form, server can not test which image was clicked by refering to pairs name=value, that would exclude the forms sent from IE and Opera browsers. Detection have to be done accordint to names with coordinates. Remember that PHP scripts replace “dot” character by “underscore” (eg image_y = 18).

Checkboxes are used to set disable status of the image elements with the view of button picture and for testing of stop submitting by disabled element. Take note of submitting checkbox status information. Only when checkbox is checked pair name=on is submitted. When the checkbox is not checked, no information about the checkbox is submitted.

Source –


Posted on March 26, 2013, in Web and tagged , , , , . Bookmark the permalink. 1 Comment.

  1. This is the third time I’ve been to your website. Thanks for sharing more details.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: