2009-04-25

Get is_secure of current action

Ever wondered if a currently running action is secure? Try
$sf_context->getActionStack()->getLastEntry()->getActionInstance()->isSecure()

2009-04-21

Calling submit method doesn't trigger onsubmit event

First, this is the proper behavior, as David Flanagan writes in his book.

Second, how to overcome this?

Suppose you have TinyMCE control embedded in a form. It sets his callback on a form's onsubmit to clean himself up and write all the stuff back to parent textarea. If you have a link that triggers submit(), just create a hidden <input type="submit"> and call click() on it.

Click on submit button does trigger the onsubmit event of a form, giving TinyMCE a chance to properly save his contents.