How to use JavaScript in forms?
问题 How to add your own JavaScript to the forms which are generate by Doctrine ? For example, where can I add a script onFocus in an input form generated by symfony ? Edit : @Benoit : I have tried your method but, it doesn't work. My function renderJavascript : public function renderJavascript() { $(function() { $('.form').focus(function(){this.blur()}); }); And I have override the method render as you show me but there is no error but it does nothing. I think it is a little error but I begin