ID:               37801
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wilco at pangeadc dot nl
-Status:           Open
+Status:           Feedback
 Bug Type:         DOM XML related
 Operating System: windows
 PHP Version:      5.1.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2006-06-14 11:42:49] wilco at pangeadc dot nl

Description:
------------
It seems to me PHP is unable to find the ID of input elements using the
loadHTML function.

I've tried many combinations and I can locate any element with this
script accept the input. The problem also occures on
domdoccument::getElementById.

Reproduce code:
---------------
<?PHP
$htmlcode = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\";>
<html><head><title>Foo my bar</title></head>
<body><input id=\"my_input\" /><textarea cols=\"3\" rows=\"2\"
id=\"my_textarea\" /></body>
</html>";

$html = new DOMDocument();
$html->loadHTML($htmlcode);
$html->validate();
$input = $html->getElementsByTagName('input')->item(0);
echo "input: ";
var_dump($input->getAttributeNode('id')->isId());

$textarea = $html->getElementsByTagName('textarea')->item(0);
echo "textarea: ";
var_dump($textarea->getAttributeNode('id')->isId());

?>

Expected result:
----------------
input: bool(true)
textarea: bool(true)

Actual result:
--------------
input: bool(false)
textarea: bool(true)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37801&edit=1

Reply via email to