Why does this code not work??
nw.document.writeln ("<tr><td width=50><td width=130 class=lbl><b>Company Name:</b></lbl><td>" & document.frmorder.txtco_name.value & ("</td></td></td></tr>"
nw.document.writeln ("<tr><td width=50><td width=130 class=lbl><b>Postal Address:</b></lbl><td>" & document.frmorder.txtaddr.value & ("</td></td></td></tr>"
nw.document.writeln (if document.frmorder.txtsuburb.value <> "" then nw.document.writeln ("<tr><td width=50><td width=130 class=lbl><b>Suburb:</b></lbl><td>" & document.frmorder.txtsuburb.value & ("</td></td></td></tr>"
The first two lines are required fields in the form so will always be written to the invoice (and they work) The third line is writing a non-required field and I get a syntax error with the if statement.
So if "txtsuburb" is not blank then write it, else leave it out. Can this be done?
Thanks in advance
Grattan
nw.document.writeln ("<tr><td width=50><td width=130 class=lbl><b>Company Name:</b></lbl><td>" & document.frmorder.txtco_name.value & ("</td></td></td></tr>"
nw.document.writeln ("<tr><td width=50><td width=130 class=lbl><b>Postal Address:</b></lbl><td>" & document.frmorder.txtaddr.value & ("</td></td></td></tr>"
nw.document.writeln (if document.frmorder.txtsuburb.value <> "" then nw.document.writeln ("<tr><td width=50><td width=130 class=lbl><b>Suburb:</b></lbl><td>" & document.frmorder.txtsuburb.value & ("</td></td></td></tr>"
The first two lines are required fields in the form so will always be written to the invoice (and they work) The third line is writing a non-required field and I get a syntax error with the if statement.
So if "txtsuburb" is not blank then write it, else leave it out. Can this be done?
Thanks in advance
Grattan