seattlemom41
Programmer
I'm trying to get a document.write to work based on the results of a JS "If". w3c validator says script not allowed where it's placed. It isn't processing the If - the first document.write is done whether the if is true or false.
DOCTYPE is XHTML 1.0 Transitional, xml is v1.0, utf 8. This is being used with shopping cart software; tech support says I can only use "simple JS" in this document.
Here's the basic layout of my code with specifics of the If:
What am I doing wrong?? Thanks in advance.
DOCTYPE is XHTML 1.0 Transitional, xml is v1.0, utf 8. This is being used with shopping cart software; tech support says I can only use "simple JS" in this document.
Here's the basic layout of my code with specifics of the If:
Code:
<table...> (display layout)
<tr><td><form...>
<table>
<tr>
<td>
// Here's the script:
<script type="text/javascript">
// Don't ask for shipping info if the purchase is a download only
<!--
var x=9
var y=8
if(x<y){
document.write('<tr><td colspan="2" align="center"><input type="hidden" name="shipmethod" value="1" />(lots more hidden inputs)</td></tr>');
}else{
document.write.('<tr><td colspan="2" align="left"><div align="left"><input name="shipname" size="40"></div>(lots more visible inputs)</td></tr>')
}
//-->
</script>
<tr><td>(some more stuff)
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
What am I doing wrong?? Thanks in advance.