Re: DOM Bug?



motion musso: aka sathia wrote:
Hello

Reproduce code:
---------------
Html:
this textarea has inside it a reference to an external image
[...]
<textarea><img src="foobar" /></textarea>
[...]


Php:

$documentx = new DOMDocument();
$documentx->loadHTML($data);
$textareas = $documentx->getElementsByTagName("textarea");
foreach($textareas AS $textarea){
print($textarea->getAttribute("value"));
print($textarea->textContent);
}

I know there's no "value" attribute in the textarea, but if the content of
said textarea is wrapped in < and > there's no way to read it.

ideas?

I haven't tried this particular one, but is it maybe considered a child node of the textarea?

I'm just not sure if this is valid xml or not - don't know if you can have an img within a textarea.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages

  • Re: Visual Mode Prompt
    ... I found several PHP pages which warned that this option would be offered. ... Some advised to accept the "Use Visual Mode" option some advised to reject ... > In one of the html pages I create, there is a TEXTAREA control. ... >> Are you seing this prompt on numerous webpages that you visit, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: [PHP] Textarea update problem
    ... Subject: [PHP] Textarea update problem ... columns by ID) and put the column contents into 3 textarea objects. ... If you think this is a server error, ... echo $row; ...
    (php.general)
  • Re: Best way to share PHP code
    ... the text box there and the rest of the source spills out into the html ... I guess this is more of a html question than php but I'm also ... http://www.cse.msu.edu/~meyerro3/projects_files/Makenews/sources.broken.php Notice it works fine for shownews.php and main.css, however for makenews.html my textarea gets closed then my div gets closed and a submit button is sitting outside of the source box. ... <div class="example"> ...
    (comp.lang.php)
  • Re: onclick event
    ... I have 4 check box and a textarea. ... function and append value in variable output. ... get value in php variable inside the function. ...
    (comp.lang.php)
  • Re: [PHP] Textarea update problem
    ... Subject: [PHP] Textarea update problem ... columns by ID) and put the column contents into 3 textarea objects. ... And all in one script. ... echo $row; ...
    (php.general)