in reply to Re: Re: Image Button
in thread Image Button

I'm not sure they actually pass a value, as in value="$value", but they do pass the x and y coordinates of where the user clicked. Lets say you put two images in the same form named ImageSubmit1 and ImageSubmit2, you could check which one they clicked by using
if (defined($cgi->param('ImageSubmit1.x')) { #Do some code associated with ImageSubmit1 } elsif (defined($cgi->param('ImageSubmit2.x')) { #Do some code associated with ImageSubmit2 }
This way you can figure out what image the user clicked on.

Dave

Replies are listed 'Best First'.
Re: Re: Re: Re: Image Button
by jeffpflueger (Beadle) on Mar 17, 2001 at 03:25 UTC
    Maybe, but I think that it is x and y for each individual image. So unless one made sneaky buttons that had different areas people would want to click on, this wouldn't quite work, and definately wouldn't work if the images didn't show up at all, and just the ALT text (for a blind user, someone with images off, etc) "No matter where you go, there you are." Jeff Pflueger - Struggling Perl knowledge sponge
      But as I mentioned elsewhere, if you click on Image1, the Image1.x and Image1.y will be defined, but Image2.x and Image2.y will be undefined.

      However, you point out a major shortcoming with form image items -- there is no alt text. If you can't load the image or the browser doesn't support it, the user will have no idea where to go from there.


      Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain