G
Guest
I have been having major problems with the IF statement.
it does not run through the whole script.
this is part of my script, to show you how my script is made up.
are their any rules on where the ; goes ?
or the { or }
I can not figure this out at all.
the following is in a file called showorders.htm, this file is displayed in
a table and its content is refreshed when a button in another table is
clicked.
does the extension .htm make a difference, do the files have to be .html
?
I have no idea what is wrong,
thanks for you help.
Jason
function showorders()
{
alert("start of show orders script")
var form = document.forms.favororders;
document.write("1");
if (form.Avocado.value!=0) {
document.write("Avocado ="+adddecimal((form.Avocado.value)*cAvocado));
}
alert("after the first if in show orders script")
if (form.ButterSquash.value!=0) {
document.write("ButterSquash
="+adddecimal((form.ButterSquash.value)*cButterSquash));
}
if (form.Cauliflower.value!=0) {
document.write("Cauliflower
="+adddecimal((form.Cauliflower.value)*cCauliflower));
}
if (form.CornOnCob.value!=0) {
document.write("CornOnCob
="+adddecimal((form.CornOnCob.value)*cCornOnCob));
}
if (form.Cucumber.value!=0) {
document.write("Cucumber
="+adddecimal((form.Cucumber.value)*cCucumber));
}
if (form.Garlic.value!=0) {
document.write("Garlic ="+adddecimal((form.Garlic.value)*cGarlic));
}
document.write("2");
if (form.Grapefruit.value!=0) {
document.write("Grapefruit
="+adddecimal((form.Grapefruit.value)*cGrapefruit));
}
}
it does not run through the whole script.
this is part of my script, to show you how my script is made up.
are their any rules on where the ; goes ?
or the { or }
I can not figure this out at all.
the following is in a file called showorders.htm, this file is displayed in
a table and its content is refreshed when a button in another table is
clicked.
does the extension .htm make a difference, do the files have to be .html
?
I have no idea what is wrong,
thanks for you help.
Jason
function showorders()
{
alert("start of show orders script")
var form = document.forms.favororders;
document.write("1");
if (form.Avocado.value!=0) {
document.write("Avocado ="+adddecimal((form.Avocado.value)*cAvocado));
}
alert("after the first if in show orders script")
if (form.ButterSquash.value!=0) {
document.write("ButterSquash
="+adddecimal((form.ButterSquash.value)*cButterSquash));
}
if (form.Cauliflower.value!=0) {
document.write("Cauliflower
="+adddecimal((form.Cauliflower.value)*cCauliflower));
}
if (form.CornOnCob.value!=0) {
document.write("CornOnCob
="+adddecimal((form.CornOnCob.value)*cCornOnCob));
}
if (form.Cucumber.value!=0) {
document.write("Cucumber
="+adddecimal((form.Cucumber.value)*cCucumber));
}
if (form.Garlic.value!=0) {
document.write("Garlic ="+adddecimal((form.Garlic.value)*cGarlic));
}
document.write("2");
if (form.Grapefruit.value!=0) {
document.write("Grapefruit
="+adddecimal((form.Grapefruit.value)*cGrapefruit));
}
}