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

Chapter 11. 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 0,0 is the top-left corner) of the cursor.

To use an image to submit data:

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

2.
Type < INPUT TYPE="image".

3.
TypeSRC="image.url", where image.url is the location of the image on the server.

4.
TypeNAME="name". When the visitor clicks on the image, the x and y coordinates of the mouse will be appended to the name defined here and sent to the server.

5.
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