|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37801 PHP doesn't see the ID of input elements
Submitted: 2006-06-14 11:42 UTC Modified: 2006-06-22 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: wilco at pangeadc dot nl Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.1.4 OS: windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: wilco at pangeadc dot nl
New email:
PHP Version: OS:


 [2006-06-14 11:42 UTC] wilco at pangeadc dot nl
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:
$htmlcode = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">
<html><head><title>Foo my bar</title></head>
<body><input id=\"my_input\" /><textarea cols=\"3\" rows=\"2\" id=\"my_textarea\" /></body>

$html = new DOMDocument();
$input = $html->getElementsByTagName('input')->item(0);
echo "input: ";

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


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

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-14 12:31 UTC]
Please try using this CVS snapshot:
For Windows:
 [2006-06-22 01:00 UTC] 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".
 [2009-01-19 20:39 UTC] bozle at bluewin dot ch
I have got the same problem. PHP Version 5.2.8; Debian Etch.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 03:01:33 2024 UTC