#44768 [Opn->Bgs]: getAttribute can't find textarea value
| From: | chregu@php.net | Date: | Fri, 18 Apr 2008 04:42:02 +0000 |
| Subject: | #44768 [Opn->Bgs]: getAttribute can't find textarea value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-124346@lists.php.net to get a copy of this message | ||
ID: 44768
Updated by: chregu@php.net
Reported By: sathia dot musso at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: linux
PHP Version: 5.2.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
If there's no attribute "value" then there's nothing to print then
there's no output.
print $textarea->nodeName;
instead of
print $textarea->getAttribute("value");
does produced some expected thing.
Previous Comments:
------------------------------------------------------------------------
[2008-04-17 22:51:51] sathia dot musso at gmail dot com
Description:
------------
I know there's no such attribute value="" but you can't access the
content ($textarea->textContent will not work as well) of that if the
content inside is wrapped within "lt" and "gt" <textarea><won't
read></textarea> (ie when you read embed tags from textarea)
Reproduce code:
---------------
$documentx = new DOMDocument();
$documentx->loadHTML($data);
$textareas = $documentx->getElementsByTagName("textarea");
foreach($textareas AS $textarea){
print($textarea->getAttribute("value"));
}
<textarea><img src="foobar" /></textarea>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44768&edit=1