fran
unread,May 10, 2012, 7:46:14 AM5/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sonata...@googlegroups.com
Hi,
I am almost new to Sonata Admin.
I would like to add some javascript code on fields that are present on edit form.
However, the id attribute of the input field change on each request (based upon the uniqid) :
<input type="text" id="s4fab9edbc0783_libelle" class="sonata-medium" value="" />
I would like to add this kind of code (not really this code but it is not important) :
$('#s4fab9edbc0783_libelle').change(function() {
alert('Handler for .change() called.');
});
What is the better way to do this kind of thing ?
* Get the form action and parse the url to get uniqid parameters ? Not sure that it is a good idea.
* Change the Twig for this field and add onChange attribute ?
* ...
Thanks for your answers,
Fran'