0

HelIo. Stuck so hard and need some help. I'm opening a new window by js like that

smsWin = window.open(/address", "Address", "width=520, height=250");

Opened page got a structure like that

<div id="Data" style="margin: 0px; padding: 20px;" valign="top">
    <form name="send_form" action="/send_sms.pl">
        <textarea id="textsms" class="sms" onkeyup="checklength();" onpaste="checklength();" name="text" </textarea>
//the rest of from

How can i change the value of that textarea by js? Tried a lot of solutions with document.forms like

document.forms[0].elements['textsms'].value = "smth";

or

smsWin.getElementById['textsms'].value = "smth";

and experiensing errors like .... is null or ... is undefined. Any suggestions on this?

bigbobr
  • 355
  • 4
  • 17
  • `getElementById` is a method. You call it with parentheses, not square brackets. – George Jun 06 '14 at 15:19
  • You're missing an opening quote on `window.open(/address"...);`, and `//` is not an HTML comment. Use `` – ArtOfCode Jun 06 '14 at 15:20
  • i just cut the unused information, of course there is a quote on address. The problem is that value is not changing – bigbobr Jun 06 '14 at 15:22

0 Answers0