getting a error
Which one? Technically it is correct PHP syntax (apart from the missing space between echo and the double quote perhaps), but not valid HTML/Javascript syntax.
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
Try it this way (escaping double quotes for javascript arguments):
<?php
echo"
<button type='submit' onmousedown='func(\"$item_id_g\");'>test</button>
";
?>
or this way (escaping double quotes for html attributes):
<?php
echo"
<button type=\"submit\" onmousedown=\"func('$item_id_g');\">test</button>
";
?>
broj1
Nearly a Posting Virtuoso
1,211 posts since Jan 2011
Reputation Points: 167
Solved Threads: 164
Skill Endorsements: 13