66Ton99/sfJqueryFormValidationPlugin

Javascript is not adding to response

Opened this issue · 7 comments

I followed the steps in the readme but I can not make the filter include javascript in the response.

Routes work great and the javascript code that generates's fine too.
If I check: '/backend_dev.php/sfJqueryFormVal/MyForm?sf_format=js' the code returned is correct.
The problem is when it try to add the javascript url to the response with use_dynamic_javascript () because when I call include_javascripts () in my layout, is including all but the one that is generated by the filter

My filters.yml is:

rendering: ~

remember_me:
class: sfGuardRememberMeFilter

security: ~

cache: ~

jquery_form_validation:
class: sfJqueryFormValidationFilter

execution: ~

If i chek the web debug toolbar i can see the javascript file, but is not present on my markup...

Can you help?
Thank you very much from now,
Matias

P.S: Sorry for my english !

@roldan do you use simple form submission with page reload or AJAX?

i'm using simple form submission (admin generator form)...

but the first problem is that i can't get the following code in my view..

<script type="text/javascript" src="/backend_dev.php/sfJqueryFormVal/MyForm?sf_format=js"></script>

i checked out the filter and put some var_dump() on the response->getJavascripts() and the dynamic script is included but not printed on my view...

Thanks for the fast answer!

Sorry, i wanted to put this code:

< script type="text/javascript" src="/path/to/js" > < / script >

"/path/to/js" return fine the jquery validation code.

if i do var_dump($response->getJavascripts()) on AssetHelper.php (on get_javascripts() method) the path/to/dynamic/js is not there... Only appear on web debug Config/Response section... I can't understand what's happening...

I had simular problem but I do not remember what was as the solution. Try to move up or dow filter position.

Yes, i tried changing the filter position but no success...

Hi,

I know it's been a while but I am trying to implement sfJqueryFormValidationPlugin in a production site running sf 1.4.

Were you able to make it work in the end ?

And indeed when I request such an URL: http://mySite/frontend_dev.php/sfJqueryFormVal/myForm?sf_format=js, I can read "plugins\sfJqueryFormValidationPlugin\modules\sfJqueryFormVal\templates\indexSuccess.js.php" populated with myForm details.

When I copy paste this into my module template it works.

So I guess the question is how do I get indexSuccess.js.php to be dynamically inserted ?

I understand I have to investigate this maybe: use_dynamic_javascript()...

Any help would be welcome ;-)
Kind regards,
@hourdays