Terry Olson said:
that isn't very helpful, I got this window.open code striaght from my
javascript codebook. What's wrong with it?
Hello,
there was a huge amount of errors within your page, which I don't want to
mention step by step. I'm not sure if I have understood completely what you
want. But if you want to have always FOUR table cells in each row with the
condition that on each new letter also a new row begins, then the following
code might be the right one for you. Try this and let me know if this works.
(By the way: There was NO mistake within the window.open() section of your
code!)
Nice greetings from
Thomas
Code
----------------------------
<html>
<head>
<title>Affidavit Of Records Labels</title>
<style>
TABLE {
border: thick single Black;
margin : 10px 10px 10px 10px;
}
TD {
text-align : center;
font-weight : bold;
padding : 3px 3px 3px 3px;
}
</style>
<script>
function lttr(name) {
this.name = name;
}
lttr[1] = new lttr("A");
lttr[2] = new lttr("P");
lttr[3] = new lttr("Q");
lttr[4] = new lttr("R");
lttr[5] = new lttr("S");
lttr[6] = new lttr("T");
lttr[7] = new lttr("U");
lttr[8] = new lttr("V");
lttr[9] = new lttr("W");
lttr[10] = new lttr("X");
lttr[11] = new lttr("Y");
lttr[12] = new lttr("Z");
function fcus() {
document.lblinpt.max1.focus()
}
function mkelbl() {
var form = document.lblinpt;
var otpt = "<html><head><title></title>";
otpt += "<style>.rd { color : Red; } tr { height: 0.5in; } .dta { width
:1.75; } .spcer { width : .3125; }</style>";
otpt += "</head><body style=\"font-weight: bold;\"><table
align=\"center\"width=\"100%\">\n<tr>";
for (var i = 1; i <= 11; i++) {
var lttrfld = eval("document.forms[0]." + lttr
.name + ".value");
var minfld = parseFloat(eval("form.min" + i + ".value"));
var mxfld = parseFloat(eval("form.max" + i + ".value"));
if(!isNaN(mxfld) && mxfld != 0) {
for (var w = minfld; w <= mxfld; w++) {
if (w % 4 == 0) {
otpt += "<td>" + lttr.name + " " + w + "</td></tr>\n"
if (w != mxfld) otpt += "<tr>";
}
else {
otpt += "<td>" + lttr.name + " " + w + "</td>"
}
}
if ((w-1) % 4 != 0) otpt += "</TR>\n";
otpt += "<TR>";
}
}
otpt += "</tr>\n</table>";
newwin = window.open("","output","");
newwin.document.write(otpt);
newwin.document.close();
}
</script>
</head>
<body onLoad="fcus()">
<form name="lblinpt"><table align="center">
<tr><td>Label Letter</td><td>Min. Number</td><td>Max. Number</td></tr>
<script>
for (var i = 1; i <= 11; i++) {
var result = "";
result += "<tr><td><input type=\"text\" size=\"3\" name=\"" + lttr.name +
"\" value=\"" + lttr.name + "\"></td>";
result += "<td><input type=\"text\" size=\"3\" name=\"min" + i + "\"
value=\"1\"></td>";
result += "<td><input type=\"text\" size=\"3\" tabindex=\"" + i + "\"
name=\"max" + i + "\" value=\"" + i*2 + "\"></td></tr>";
document.write(result);
}
</script>
<tr><td colspan="3"><input type="button" value="Create Labels"
onClick="mkelbl()"></td></tr>
</table>
</body>
</html>