What I have:
Try to pass variable to javascript method in such way:
$name = (string) $form->attributes()->name;
$show = 'show("'.$name.'")';
echo '<input type="radio" onclick="'.$show.'">'.$form['description'].'<br />';
print_r($show); // show("feedback")
...
<script>
function show(name) {
//DEBUG HERE!
...
}
</script>
What a problem:
In browser's debugger I can see that into show method I've passed the whole form (means that argument name equals to the whole form).
Question:
Why does it happen? How to pass to js-method only form's name?