Click to See Complete Forum and Search --> : Correct Syntax using document.writeln


tlflow
06-24-2004, 10:54 AM
My form is not being "written" to the browser. I know it has something to do with the way I'm trying to push the variables from the form to my rightframe using the document.Doc.target='rightframe' when I'm submitting the page.

See, when I try the code outside of the document.writeln(''); it works fine. The 'rightframe' part has to be cutting the line short. Is there any way to have javascript read past the ''s (possibly like how you would use \ before quotes in PHP)?


document.writeln('<form name="Doc" action="page.htm" method="GET" onSubmit="document.Doc.target='rightframe'; return true;>');


Thanks,

Khalid Ali
06-24-2004, 11:03 AM
personaly I do not recomend using document.write unless you know exactly what is the logical flow of evvents in the page.
second if all else is correct then you need to escape the quotes like below
onSubmit="document.Doc.target=\'rightframe\';