Re: Using custom "button" form element instead of standard "submit"?
| From: | Durwood Gafford | Date: | Thu, 30 Jan 2003 11:18:01 +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-133627@lists.php.net to get a copy of this message | ||
sure this would work but it'd be VERY inefficient in my application. It's a
file browser application so i have hundreds of folder icons on a page .. the
'submit' element will pass back the name of the button clicked and it would
be available immediately/directly, which is what i want. BUT an 'image'
element would require me to loop through ALL buttons doing an 'isset' test
on each one.
I can't believe html provides no means for using an icon as a submit button.
well i'm off pursuing a javascript solution now.
by the way .. unrelated question ... why would one want to use
$_REQUEST['foo'] instead of just $foo? doesn't php give you access to form
variables using the latter construct which is much cleaner?
"Philip Olson" <philip@cornado.com> wrote in message
news:Pine.BSF.4.10.10301300503280.83137-100000@localhost...
>
> [snip]
> > 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
> [snip]
>
> This is how it's done. If this is set, the button
> was clicked. For example:
>
> if (isset($_REQUEST['thebuttonname_x'])) {
>
> print "The button was clicked";
> }
>
> Regards,
> Philip
>
>