Re: DOM Bug?



On Fri, 18 Apr 2008 16:37:16 GMT, in alt.php "motion musso: aka
sathia" <sathia.musso@xxxxxxxxx>
<074Oj.292512$%k.403029@xxxxxxxxxxxxxxxxxx> 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'd look at the library that you are using and checking what
'textContent' is looking at and it's return value.

AFAIK, textarea contents can be accessed by
value or childNodes[0].nodeValue
-- -------------------------------------------------------------
jnorthau@xxxxxxxxxxxxxxxxxxxxx : Remove your pants to reply
-- -------------------------------------------------------------
.



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)