What a very cool nick 🙂
php has nothing to do with client side scripting, you can push output to client which can in turn include generated JS if one should be so inclined.
In a nutshell, php is purely server side with no means of linking to "dynamic" client side code during exec.
To actually answer your question (if I understood it correctly), yes, you can send a form post and php can be made to evaluate it and do as required.
hth.