Hi, I have a small function which is giving an error on page load and when the function is fired. The code is: function cost(stitchout) { if(stitchout == "1" && form1.eststitches.value>5000) { form1.estcost.value = CurrencyFormatted(((form1.eststitches.value/1000)*0.25) + 0.50); } else if(stitchout == "1" && form1.eststitches.value<=5000) form1.estcost.value = 1.75; } else if(stitchout == "0" && form1.eststitches.value>5000) { form1.estcost.value = CurrencyFormatted(((form1.eststitches.value/1000)*0.5) + 0.50); } else if(stitchout == "0" && form1.eststitches.value<=5000){ form1.estcost.value = 3.00; } } Code (markup): The error i get on page load is: Line: 19, character: 2, Error: Syntax Error In the Above code, first line is 13 and last line is 30. The error i get on "Onblur" Even (when function is called): Line: 343, character: 1, Error: Object Expected Line 343 is a simple <td> block with a Div align right tag. It has nothing to do with the JS. Kindly help me solve this error. Regards Talker.
Hey, got your pm and i'm here For the first error you miss blanket { on line 19. else if(stitchout == "1" && form1.eststitches.value<=5000) [COLOR="Red"]{[/COLOR] form1.estcost.value = 1.75; } Code (markup): For second error, it might cause from the first error. When you try to call function but the function contains error so it throw another error. PM. me if you still encounter problem
Wowowow !! You cought it m8, thanks for the help. Adding the { fixed my JS. rep given to you for your help ! Talker.