G
Guest
Please could someone tell me how i insert a IF statement within a .JS file
i have a script file called myscript1.js
when it is called it calculates a sum and depending on the answer it will
print certain words.
i.e.
function Gettotal()
{
var form = document.forms.selecteddata;
if eval(form.Avocado.value)>0
{
parent.orderlist.document.getElementById('b_Avocado').innerHTML =
adddecimal(eval(form.Avocado.value*cAvocado));
}
}
if you are not sure what i mean, please ask for another example of what i am
trying to do.
i am trying to have an IF statment in side a script function.
but the script does not run, if i take out the IF staement the rest of the
script runs ok, but i need to have stuff printed in parts of the window if
the sum is a certain number.
Thank you
i have a script file called myscript1.js
when it is called it calculates a sum and depending on the answer it will
print certain words.
i.e.
function Gettotal()
{
var form = document.forms.selecteddata;
if eval(form.Avocado.value)>0
{
parent.orderlist.document.getElementById('b_Avocado').innerHTML =
adddecimal(eval(form.Avocado.value*cAvocado));
}
}
if you are not sure what i mean, please ask for another example of what i am
trying to do.
i am trying to have an IF statment in side a script function.
but the script does not run, if i take out the IF staement the rest of the
script runs ok, but i need to have stuff printed in parts of the window if
the sum is a certain number.
Thank you