Re: Directing form to different handlers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks to all posters for their input.

For what it's worth, I'm writing a PHP application for a very specific purpose of running my office billing etc so I have total control over the JavaScript settings for users. The entire application would break without JS so if they turn JS off, all they get is a page telling them to turn it back on.

I know I could direct all form submissions to one handler, and easily figure out which button was actually used to submit the form and use a SWITCH, but I like the idea of having the code in smaller segments. It makes it easier for me to find what I'm looking for. Just a personal preference.

I actually found some nice JS to change the form action dynamically using by using the button to set the value of the variable "handler" to "edit.php" or "delete.php" etc etc

document.myform.action = handler;
document.myform.submit();

Thanks again.
Angus


----- Original Message ----- From: "Matthew McKay" <matt@xxxxxxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Tuesday, June 02, 2009 5:32 AM
Subject: Re:  Directing form to different handlers?


It would be much simpler and cleaner to use Javascript to modify the form's
action attribute onClick.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux