I would like to send a var from a php script to javascript. Here is what I have so far:
<script>
function showEditMenuItemForm(name) {
document.getElementById('editMenuItemForm').style.display = 'block';
document.editMenuItemForm.menuitem_edit.value == '+name+';
document.editMenuItemForm.menuitem_edit.focus();
document.getElementById('linkOpenAddMenuListForm').style.display = 'none';
document.getElementById('addNewMenuItemForm').style.display = 'none';
}
</script>
<?php
if($sygroup == '3') {
$valueRname = $extract['name'];
echo '
<p>
'.$extract['name'].'
<a onClick="return returnDeleteSure()" href="systemdeletemenuitem.php?id='.$idfinal.'">
<img src="img/deleteicon.png" class="icon12">
</a>
<img onClick="showEditMenuItemForm('.$valueRname.')" src="img/Edit File-32.png" class="icon12">
</p>
';
}
?>
I don't know why but the value isn't the php var (It is empty instead of 'Test' e.g). So the script doesn't work.
I hope you can help me!
Sorry for my bad English btw, I hope you understand the question :)