Re: Using custom "button" form element instead of standard "submit"?
| From: | Durwood Gafford | Date: | Thu, 30 Jan 2003 04:44:38 +0000 |
| Subject: | Re: Using custom "button" form element instead of standard "submit"? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133592@lists.php.net to get a copy of this message | ||
This suggested solution is not quite what i was looking for (I was aware of
it already):
A: input TYPE=IMAGE NAME="parent" VALUE="foo" SRC="icon.gif">
The above uses an image as a bitmap and gets the x,y values where it was
clicked. I'd like to use an ICON (instead of a standard submit button) and
only care about WHICH icon was clicked, not where on the bitmap.
Presumably the correct HTML is to use the BUTTON type as follows:
B: <button type="submit" name="parent" value="foo"><img
src="icon.gif"></button>
but this does not work. And of course,
C: <input type="submit" name="parent" value="foo">
gives the standard submit button.
One suggestion was to add a "src=icon.gif" attribute to the submit type
directly above (example C), but that didn't change the button ... it still
had the standard button.
I assume i could use solution "A" above, and parse the _x out of the "name"
value .. but this seems pretty hoaky and it's my understanding soultion B is
"correct" HTML and SHOULD work! Is it a bug in php that it is causing it
not to work? or is the "button" construct depricated? or am i
misunderstanding how that "BUTTON" construct is supposed to work?
Sorry to be dense about this but it seems like a simple concept that's
frustratingly difficult.
-Durwood
"Don Read" <dread@texas.net> wrote in message
news:XFMail.20030129141031.dread@texas.net...
>
> On 27-Jan-2003 Durwood Gafford wrote:
> > I can't figure out how to tell which button was pressed by a user when
i'm
> > using a "button" instead of a standard "submit" form element.
> >
> > This works:
> >
> > <input type="submit" name="parent" value="foo">
> > $parent will equal "foo"
> >
> > This doesn't work:
> >
> > <button type="submit" name="parent"
> > value="foo"><img
> > src="icon.gif"></button>
> > $parent will equal "<img src="icon.gif"> NOT "foo"
> >
> > How do I get the value of "foo" to be returned in $parent and still use
a
> > graphical icon instead of a standard submit button?
> >
>
> <input TYPE=IMAGE NAME="parent" VALUE="foo" SRC="icon.gif">
>
> Regards,
> --
> Don Read dread@texas.net
> -- "Beer is proof that God loves us and wants us to be happy."