Reputation: 520
i am echoing html with php echo
for example :
echo "<span onClick='popUpWin('add_page.php?id=".$row[Id]."', 'standard', '1000', '600',30,150)'><img src='images/editbtn.png' class='ddpngfix'></span>";
it is displaying data as it should be, my problem is when i click on image it is not calling function popUpWin, it is present on the same page, and when i checked in firebug inspect element it is showing span element totally broken, please check below image
i know quotes are making problem , How to solve this ?
Upvotes: 0
Views: 79
Reputation: 31739
Escape the '
s properly -
echo "<span onClick=\"popUpWin('add_page.php?id=".$row['Id']."', 'standard', 1000, 600 ,30,150)\"><img src='images/editbtn.png' class='ddpngfix'></span>";
No need for '
s around numbers.
Upvotes: 4
Reputation: 3195
Add "
for onclick
and escape it like below:
echo "<span onclick=\"popUpWin('add_page.php?id=".$row['Id']."', 'standard', 1000, 600 ,30,150)\"><img src='images/editbtn.png' class='ddpngfix'></span>";
Upvotes: 4