see anything wrong (xhtml validator)
| From: | Sebastian | Date: | Sun, 20 Mar 2005 21:41:48 +0000 |
| Subject: | see anything wrong (xhtml validator) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211151@lists.php.net to get a copy of this message | ||
it seems the xhtml validator is throwing an error with:
------------------------------------------------------
Line 530, column 12: value of attribute "id" invalid: "1" cannot start a
name
<div id=" 1 79" style="display: none;">
------------------------------------------------------
Here is the code:
$outnews = "
<div class=\"fade\" style=\"padding-top : 5px; padding-bottom : 5px\">
<b>continues »</b> <a
href=\"/shownews/".$news['id']."\"
onclick=\"return hidetoggle('".$news[id]."');\"
onmouseover=\"window.status='".$news['status']."'; return
true;\"
onmouseout=\"window.status=''; return true;\"><b>" .
stripslashes($news['morelink']) . " (" . $count . " more
words)</b></a></div>
<div id=\"".$news['id']."\" style=\"display: none;\">
<div class=\"newsleft\">" . $news['moretext'] .
"</div></div>";
for some odd reason the validator is showing a space before the $news['id']
in the <div> id tag, even though the actual news ID is fine and there are no
spaces in the raw xhtml code above.. maybe im blind ..
i'd really like to get rid of the \" escapes and just use single quotes, but
i would guess i have to escape the javascript single quotes?