RE: [PHP] Calling functions from Button actions
| From: | Vail, Warren | Date: | Sat, 13 Sep 2003 00:40:00 +0000 |
| Subject: | RE: [PHP] Calling functions from Button actions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-162486@lists.php.net to get a copy of this message | ||
I would assume you are referring to PHP functions since that is the nature of this list and since
PHP only really executes on a web server, and since the button click occurs on the browser machine,
in it's strictest sense the answer to your first question "Is their an easy way to call a
function based upon a button action?" is a qualified no.
However, you can simulate a direct connection by using JavaScript to sense the OnClick event on the
browser machine and to force a form submit which invokes the form PHP module on the server.
One technique I like to use is to define multiple "submit" buttons with different values
and each one automatically triggers the form submit, and then I can sense the button clicked by
looking for its value in my PHP code (all buttons invoke the same PHP module specified in the form
Action field). Your user will feel like the application is more interactive, however response will
be much slower than JavaScript (running on the browser). If your user expects the same response he
gets on a standalone application running on his own computer, then your user is too naive, and you
should get a new one ;-).
hope this helps,
Warren Vail
-----Original Message-----
From: Robert Cummings [mailto:robert@wocmud.org]
Sent: Friday, September 12, 2003 3:36 PM
To: Dan J. Rychlik
Cc: php-general@lists.php.net
Subject: Re: [PHP] Calling functions from Button actions
Any form system (I'm guessing, but I only use my own so I could be
mistaken) that allows custom validation should enable trivial function
calling based on a button click.
Cheers,
Rob.
On Fri, 2003-09-12 at 18:29, Dan J. Rychlik wrote:
> Is their an easy way to call a function based upon a button action?
>
> -Dan
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php