RE: missing part of the variable

by "tim booker" <timbooker(at)btinternet.com>

 Date:  Sat, 2 Jun 2001 12:35:44 +0100
 To:  "HWG \(E-mail\)" <hwg-techniques(at)hwg.org>
 In-Reply-To:  lodz
  todo: View Thread, Original
>    document.write("<INPUT type='text';
>      name='textfield1';  value="+YouWrote+">");

That code will still produce the same error as before, because the resulting
HTML still lacks quotes around the contents of YouWrote.

Personally, I would use the following:

document.write('<INPUT type="text" name="textfield1"
 value="' + YouWrote + '">');

Note the usage of single and double quotes.  I prefer to use single quotes
in JavaScript, because it allows you to insert HTML, which includes double
quotes, without further complication.

Hope this helps,

Tim

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA