Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am still stuck.

Status
Not open for further replies.

wwcbill

Programmer
Jul 31, 2002
11
US
This is what I mean when I say I can not pass the parms. I can not get it to print. Please please please help!
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc(testData) {
document.write('<table border=0 bgcolor=#CCCCCC>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=15 width=97% bgcolor=#EEEEEE>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=0 cellspacing=0>');
document.write('<tr><td align=right>Name:</td><td><input value=&quot;William Corbett&quot; size=&quot;40&quot;> </td><tr>');
document.write('<tr><td align=right>My Message:</td><td><input value=></td> ');
//---------
// This is the line I can not get to work. I can not pass the parm and get it to print and I can not get it to print the same size as the line above.
//---------
document.write('<tr><td> + testData + size=&quot;40&quot;</td></tr>');
//---------
document.write('<tr><td>&nbsp;</td><td><input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;>');
document.write('</table>');
document.write('</form></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script Language=&quot;JavaScript&quot;>
testFunc(&quot;this is a test 1&quot;);
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true);
while(!myInputTextStream.AtEndOfStream){
testFunc(myInputTextStream.ReadLine());
}

// Close the input
myInputTextStream.Close();
</script>

</table>
</BODY>
</HTML>
 
shouldn't it be:
document.write('<tr><td>' + testData + 'size=&quot;40&quot;</td></tr>');

notice the extra '+ ... +' for proper concatenation
 
I coded it incorrectly. It shoud be the 2 lines below. Or combine them into 1 line.Please help Mr.Conehead.
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc(testData) {
document.write('<table border=0 bgcolor=#CCCCCC>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=15 width=97% bgcolor=#EEEEEE>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=0 cellspacing=0>');
document.write('<tr><td align=right>Name:</td><td><input value=&quot;William Corbett&quot; size=&quot;40&quot;> </td><tr>');

//---------
// This is the 2 lines I can not get to work. I can not pass the parm and get it to print and I can not get it to print the same size as the line above.
//---------
document.write('<tr><td align=right>My Message:</td><td><input value=></td> ');
document.write('<tr><td> + testData + size=&quot;40&quot;</td></tr>');
//---------

document.write('<tr><td> </td><td><input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;>');
document.write('</table>');
document.write('</form></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script Language=&quot;JavaScript&quot;>
testFunc(&quot;this is a test 1&quot;);
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true);
while(!myInputTextStream.AtEndOfStream){
testFunc(myInputTextStream.ReadLine());
}

// Close the input
myInputTextStream.Close();
</script>

</table>
</BODY>
</HTML>




 
are these to be hideen fields? if so- you should include type=hidden

<input type=hidden value=....>

also, you are not concatonating this line correctly,
instead of:

document.write('<tr><td> + testData + size=&quot;40&quot;</td></tr>');
it should be

document.write('<tr><td colspan=2>' + testData + 'size=&quot;40&quot;</td></tr>');

notice the ' before the first and after the second... also since this row only has 1 cell, notice the colspan=2
 
This is how it prints. I can not get the message to print on the same line following &quot;My Message&quot;. And I can not Get the size paramter to work either. I have tried your code and this is the results.
__________________________
Name:William Corbett

My Message:
this is a test 1size=&quot;40&quot;
__________________________

This is the code>

<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc(testData) {
document.write('<table border=0 bgcolor=#CCCCCC>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=15 width=97% bgcolor=#EEEEEE>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=0 cellspacing=0>');
document.write('<tr><td align=right>Name:</td><td><input value=&quot;William Corbett&quot; size=&quot;40&quot;> </td><tr>');
document.write('<tr><td align=right>My Message:</td><td><input value=></td> ');
document.write('<tr><td colspan=2>' + testData + 'size=&quot;40&quot;</td></tr>');
document.write('<tr><td>&nbsp;</td><td><input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;>');
document.write('</td></tr>');
document.write('</table>');
document.write('</form></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script Language=&quot;JavaScript&quot;>
testFunc(&quot;this is a test 1&quot;);
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true);
while(!myInputTextStream.AtEndOfStream){
testFunc(myInputTextStream.ReadLine());
}

// Close the input
myInputTextStream.Close();
</script>

</table>
</BODY>
</HTML>



 
Remove the size=&quot;40&quot; from this line: document.write('<tr><td colspan=2>' + testData + 'size=&quot;40&quot;</td></tr>');. It's not necessary. The value of testData will dictate the size of the printed field.

There's always a better way...
 
ok then- here is the probelm.... this is what you have:

document.write('<tr><td align=right>My Message:</td><td><input value=></td> ');
document.write('<tr><td colspan=2>' + testData + 'size=&quot;40&quot;</td></tr>');

and it should be

document.write('<tr><td align=right>My Message:</td>');
document.write('<td>' + testData + 'size=&quot;40&quot;</td></tr>');

Notice- I removed the <tr> after the second document.write- they were not on the same line because you were starting a new row... Also I took out the empty cell that was <td><input value=></td> and we do not need the colspan=2 now so that has been removed
 
I would like to thank you all for your help, but I have not explained what I am trying to do. Following is the results I get when I run the program as it is. My message comes out without being a box, and I can not tell 'My message' from the text 'this is a test 1size=&quot;40&quot;'. And I still can not stop the 'size=&quot;40&quot;' from being concatenated to the message.
-----------------The results-------------------------------
------------------------------
Name: |William Corbett |
------------------------------

My
Message:this is a test 1size=&quot;40&quot;
---------------------------------------------------


----------This is what I trying to produce.-----------
------------------------------
Name: |William Corbett |
------------------------------

My ------------------------------
Message:|this is a test | |
------------------------------

Following is the code I am executing. Please copy the code and execute it. Thank you.
<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc(testData) {
document.write('<table border=0 bgcolor=#CCCCCC>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=15 width=97% bgcolor=#EEEEEE>');
document.write('<tr><td>');
document.write('<input type=&quot;hidden&quot; name=&quot;type&quot; value=&quot;1&quot;>');
document.write('<input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;39241&quot;>');
document.write('<table border=0 cellpadding=0 cellspacing=0>');
document.write('<tr><td align=right>Name:</td><td><input value=&quot;William Corbett&quot; size=&quot;40&quot;> </td><tr>');
document.write('<tr><td align=right>My Message:</td>');
document.write('<td>' + testData + 'size=&quot;40&quot;</td></tr>');
document.write('<tr><td>&nbsp;</td><td><input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;>');
document.write('</table>');
document.write('</form></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script Language=&quot;JavaScript&quot;>
testFunc(&quot;this is a test 1&quot;);
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true);
while(!myInputTextStream.AtEndOfStream){
testFunc(myInputTextStream.ReadLine());
}

// Close the input
myInputTextStream.Close();
</script>

</table>
</BODY>
</HTML>

 
ok this should do it:

new: td's have nowrap, put testdata into input type=text if that is what you wanted...

<HTML>
<HEAD>
<TITLE>Title of your page</TITLE>
<META NAME=&quot;generator&quot; CONTENT=&quot;ToniArts EasyHtml v.2.2&quot;>
<script LANGUAGE=&quot;javascript&quot;>
function testFunc(testData) {
document.write('<table border=0 bgcolor=#CCCCCC>');
document.write('<tr><td>');
document.write('<table border=0 cellpadding=15 width=97% bgcolor=#EEEEEE>');
document.write('<tr><td>');
document.write('<input type=&quot;hidden&quot; name=&quot;type&quot; value=&quot;1&quot;>');
document.write('<input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;39241&quot;>');
document.write('<table border=0 cellpadding=0 cellspacing=0>');
document.write('<tr><td align=right nowrap>Name: </td><td><input value=&quot;William Corbett&quot; size=&quot;40&quot;> </td><tr>');
document.write('<tr><td align=right nowrap>My Message: </td>');
document.write('<td><input value=&quot;' + testData + '&quot; size=&quot;40&quot;></td></tr>');
document.write('<tr><td>&nbsp;</td><td><input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;>');
document.write('</table>');
document.write('</form></td></tr>');
document.write('</table>');
document.write('</td></tr>');
document.write('</table>');
}
</script>
</HEAD>
<BODY>
<table border=&quot;1&quot;>
<script Language=&quot;JavaScript&quot;>
testFunc(&quot;this is a test 1&quot;);
var myFileSysObj = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var myInputTextStream = myFileSysObj.OpenTextFile(&quot;c:\\testmail&quot;,1,true);
while(!myInputTextStream.AtEndOfStream){
testFunc(myInputTextStream.ReadLine());
}

// Close the input
myInputTextStream.Close();
</script>

</table>
</BODY>
</HTML>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top