#36574 [NEW]: getElementById can`t "see" ID in html-tag <input>
| From: | taymir at gmail dot com | Date: | Wed, 01 Mar 2006 15:07:50 +0000 |
| Subject: | #36574 [NEW]: getElementById can`t "see" ID in html-tag <input> | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-93803@lists.php.net to get a copy of this message | ||
From: taymir at gmail dot com
Operating system: Windows XP pro
PHP version: 5.1.2
PHP Bug Type: DOM XML related
Bug description: getElementById can`t "see" ID in html-tag <input>
Description:
------------
I use DOMDocument::loadHTML(...) method to create DOM-tree from
html-document. I want to modify some attributes of such tags as form,
select, option, input. The code works as it should for all tags except
<input ...>. I can't get input-element by ID.
Reproduce code:
---------------
<?php
$text = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"><input id="test">';
$xml = new DOMDocument(1.0);
$xml->loadHTML($text);
var_dump($xml->getElementByID('test'));
?>
Expected result:
----------------
object(DOMElement)#2 (0) { }
Actual result:
--------------
NULL
--
Edit bug report at http://bugs.php.net/?id=36574&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36574&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36574&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36574&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36574&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36574&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36574&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36574&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36574&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36574&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36574&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36574&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36574&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36574&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36574&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36574&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36574&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36574&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36574&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36574&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36574&r=mysqlcfg