#37801 [Com]: PHP doesn't see the ID of input elements
| From: | bozle at bluewin dot ch | Date: | Mon, 19 Jan 2009 20:39:02 +0000 |
| Subject: | #37801 [Com]: PHP doesn't see the ID of input elements | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133024@lists.php.net to get a copy of this message | ||
ID: 37801
Comment by: bozle at bluewin dot ch
Reported By: wilco at pangeadc dot nl
Status: No Feedback
Bug Type: DOM XML related
Operating System: windows
PHP Version: 5.1.4
New Comment:
I have got the same problem. PHP Version 5.2.8; Debian Etch.
Previous Comments:
------------------------------------------------------------------------
[2006-06-22 01:00:02] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-06-14 12:31:43] bjori@php.net
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
------------------------------------------------------------------------
[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