I'm trying to make my Image Input pass a URL into a Javascript function using OnClick, however when I click on the input it does nothing. The code I am using is in PHP, and it echo's out a string with HTML tags in it.
echo "<input type=\"image\" onclick=\"imgp(\'" . $url . "\')\" src=\"" . $url . "\" style=\"max-width: 20%; max-height: 20%\" /><br />";
The function that is getting called is as follows:
function imgp(url){
if(url != null){
var text = document.getElementById("body").value + "[img]" + url + "[/img]";
document.getElementById("body").value = text;
imgpopup();
}
}