Re: Multiple Image Submit Buttons.
| From: | David Robley | Date: | Mon, 25 Jun 2001 02:29:38 +0000 |
| Subject: | Re: Multiple Image Submit Buttons. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55077@lists.php.net to get a copy of this message | ||
On Mon, 25 Jun 2001 11:52, Scott Guthrie wrote:
> I have a navigation section that needs to go to up to 10 pages based on
> which 'button' a user clicks on. It also has to send the form contents
> to the next page, so it has to be a 'submit'. This works for
> non-image submit buttons, because the 'name' and 'Value' tags on the
> submit tag works for them, but the 'value' component isn't supported
> for <input type="image" ...>
However, when you click an image submit, the x and y coords of the mouse
are passed as name_x and name_y (where name is the name you have assigned
to the INPUT tag); so you can test for the presence of one of those
values and branch accordingly. Slightly more convoluted than a 'text'
submit, but you don't need to rely on client side :-)
>
> I figured I could write a short javascript that is called 'onClick' of
> the button, copies a 'button number' to a hidden field, then executes
> the 'document.forms[0].submit()' function. This works just fine for
> Netscape, but the 'document.forms[0].submit()' even by itself doesn't
> work for IE 5.00.
>
> Any one have any other ideas on how to do this? multiple images for
> submit buttons (where you know which you pressed).
>
> I need to process the data in a PHP application.
>
> Thanks,
> -Scott-
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
All E-mail gladly received. Offensive reply ASAP.