document.write using variable.values

wxdqz

New Member
Hoping I can get some help. I have been pulling my hair out all weekend on this. All the books say it is done exactly the way I am doing it, but no-go.

I have an HTML file where many radio buttons are clicked, values calculated from this, and then the results displayed.

In the simplest of it, I have them fill in a Project name:

<table cellpadding="10" width="90%">
<TR><TD width="15%"><B>Project Name:</B></TD><TD width="85%"><input type="TEXT" name="TopProjectName" size ="75" value=http://www.webdeveloper.com/forum/archive/index.php/""></TD></TR>


After the click of the calculate button, a javascript piece does this:

document.Form1.BottomProjectName.value = Form1.TopProjectName.value;

then later uses this in a table displayed with the other calculated results:

<TR><TD><B><font size="+1">Project Name:</font></B></TD><TD><input type="TEXT" name="BottomProjectName" size="75" value="">
</TD></TR>


Okay... all of this works fine. BUT, what I am trying to do is to display all of the output (as directly above) in a new window using document.write. So... the last thing I do after the calculations, before I would continue and display the info at the bottom of the page, is to call a function full of document.write statements:

function DisplayResults()
{

document.write('<center>');
document.write('<H2>Determination of Release Path<BR>for CDP Project</H2>');
document.write('<TABLE border=0 align=center width="90%">');
document.write('<TR><TD align=left><img src=http://www.webdeveloper.com/forum/archive/index.php/"KP_Logo.bmp"></TD><TD align=right><img src="CDF_Logo.bmp" height=80></TD></TR>');
document.write('</TABLE>');
document.write('</center>');
document.write('<table cellpadding=10>');

//ONE
//alert(Form1.BottomProjectName.value);


//TWO
var TempString = " <TR><TD><B>Project Name: </B></TD><TD>" + Form1.BottomProjectName.value + "</TD></TR>";
//document.write(TempString);


//THREE
//TempString = Form1.BottomProjectName.value;
//document.write(TempString);



//FOUR
document.write(' <TR><TD><B><font size="+1">Business Partner: </font></B></TD><TD>$BottomBusinessPartner</TD></TR>');
document.write(' <TR><TD><B><font size="+1">Sponsor: </font></B></TD><TD>$BottomSponsor</TD></TR>');
document.write(' <TR><TD><B>&nbsp;</B></TD><TD>&nbsp;</TD></TR>');
document.write('</Table>');
...
...
...

Note that, as long as I do not have ONE, TWO or THREE in there, is write the entire thing to a new page, but the $BottomBusinessPartner and $BottomSponsor are just placeholders right now, not the value of the variable, which is what I want.

What is displayed in TWO is what should work, according to all of the books. If I use what is in THREE just to test, it prints NOTHING, including anything after that point.

Even if I just use what is in ONE to see what that value should be, it stops printing right there.

Any help on this one? Full code is here, in case you need it (about 1450 lines, this section is at around 930):

Code (<!-- m --><a class="postlink" href="http://www.nehrt.com/IRP/ReleasePath.htm">http://www.nehrt.com/IRP/ReleasePath.htm</a><!-- m -->)

Hoping on getting this finished soon, so I don't have to use the ugly, in line results I currently have.

Any info is appreciated .

Thx.

Flip
 
Back
Top