I'm using NetBeans to write PHP code embedded in HTML. When I use PHP to generate an id
attribute, as here:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="<?php echo 'TEST_ID'?>">
TEST
</div>
</body>
</html>
... I get the following error message:
Bad value " " for attribute "id" on element "tr": An ID must not contain whitespace.
How can I disable or remove this error from my Netbeans for PHP?
Solution
Haha after trying again my self found how to disable this stress IDE but I love it :D
see screenshot ^_^
It appears to be a known issue: the NetBeans HTML validator doesn't support embedded PHP code, thus it's trying to validate your literal PHP code as if it was part of the HTML received by the browser (which is of course not the case). The NetBeans team is apparently not willing to fix it (probably because it'd need a full rewrite of the feature) so you have to either live with that or disable HTML error checking. You can accomplish the latter from the hint icon (lightbulb) in the IDE margin; the feature can be disabled in a per-file bases or for all PHP files.