• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. Forms > Using an Image to Submit Data

Using an Image to Submit Data

You may use an image—called an active image—as a combination input element and submit button. In addition to submitting the data from the other fields in the form, a click on the image sends the current mouse coordinates to the server in two name-value pairs. The names are generated by adding .x and .y to the value of the name attribute. The values correspond to the actual horizontal and vertical locations (where the top-left corner is 0,0) of the cursor.

To use an image to submit data

1.
Create a GIF or JPEG image (see page 83).

2.
Type <input type=“image”.

3.
Type src=“image.url”, where image.url is the location of the image on the server.

4.
Type name=“name”, where name will be added to the mouse’s x and y coordinates and sent to the server, when the visitor clicks the image.

5.
Type alt=“description”, where description will appear if the image does not.

6.
Type the final /> to finish the active image definition for the form.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint