I am generating links from the following php code. The links appear in the browser, and the generated html code seems fine, however the links are not click-able. I have tested this in IE and FF, and tried to see with FireBug to no avail.
The code to generate my form
$uploadhtml = htmlspecialchars(json_encode("<form action='up.php' method='post'
enctype='multipart/form-data'>
<label for='file'>Filename:</label>
<input type='file' name='file' id='file'/>
<br />
<input type='hidden' name='pk' value='".$pk."'>
<input type='hidden' name='username' value='".$USERNAME."'>
<input type='submit' name='submit' value='Submit' onclick=\"setTimeout(function() {
updateByPk('Layer2', '".$pk."', '".$brand."', '".$pg."'); } ),1250);\" />
</form>"), ENT_QUOTES);
The resultant html code:
<a onclick="makewindows('"<form action='up.php' method='
post'\r\nenctype='multipart\/form-data'>\r\n<label for='
`file'>Filename:<\/label>\r\n<input type='file' name='file' id='`file'\/> \r\n<br \/>\r\n<input type='hidden' name='pk' value='
380118179930'>\r\n<input type='hidden' name='username' value='
janmaybach'>\r\n<input type='submit' name='submit' value='
Submit' onclick=\"setTimeout(function() { updateByPk('Layer2',
'380118179930', 'Ed Hardy', '1'); } ),1250);\"
\/>\r\n<\/form>"'); return false;" href="#">Upload files</a>
I guess it's a JavaScript error, but I don't know how to pinpoint it?
edit: The html code without ENT_QUOTES:
<a href="#" onclick="makewindows('"<form action='up.php' method='post'\r
\nenctype='multipart\/form-data'>\r\n<label for='file'>Filename:<\/label>\r\n<input
type='file' name='file' id='file'\/> \r\n<br \/>\r\n<input type='hidden' name='pk'
value='380118185183'>\r\n<input type='hidden' name='username' value='janmaybach'>\r
\n<input type='submit' name='submit' value='Submit' onclick=\"setTimeout(function()
{ updateByPk('Layer2', '380118185183', 'Ed Hardy', '1'); } ),1250);\"
\/>\r\n<\/form>"'); return false;">Upload files</a>
It still is not clickable..., everything seems to be quoted correctly?
When I try without htmlspecial chars, the following html output is produced:
<input type='submit' name='submit' value='Submit' onclick=" settimeout(function()="" {="" updatebypk(="" layer2="" 380118179930="" ed="" hardy="" ,="" 1="" );="" }="" ),1250);="">
'); return false;">Upload files</a>