从Sonata Admin获取表单值

I would like get value from form of Sonata Admin, but in source html i have for example:

<input type="text" class="span5" maxlength="255" required="required" name="s215268450cfc7[username]" id="s215268450cfc7_username">

s215268450cfc7 this is uniqid, but for what this is add to all fields in form? This is regenerate after refresh page.

I would like get value from this form, but i can't use:

$('#s215268450cfc7_username').val()

because this is still renames.

You can parse uniqId from the <form> element, or you can use:

$('form [id$="_username"]').val()

Also, from Twig template, you can access name something like this (depending on whether you have access to the whole form, or only to the username field):

{{ form.children.username.vars.name }}