...

View Full Version : Javascript on Frontpage forms



barneyn
05-16-2005, 12:04 PM
Hi all,

Just wondering if anyone has any ideas on why my form is not adding up correctly. :confused:

I have several lines in a table, one per item, with quantity selections and prices. I have javascript which calculates the price of each line when the user selects a quantity. Then the total is added up at the bottom for all items. This table is on a form, with a submit and reset button as well.

I select format, then behaviours, then insert, then call script, and write my code here, as I'm new to javascript and wouldn't have a clue where to put it in the raw code.

Now, having said all this, it works correctly in preview mode, however now that I have uploaded to my website, I click on quantity and nothing happens, except it says 'error on page' in the bottom left hand corner of the message area on my browser.

Are there any reasons anyone can give me as to why this might not be working when it's uploaded, but works in preview mode in FrontPage 97 ?

Any help would be greatly appreciated. :thumbsup:

fci
05-16-2005, 01:16 PM
post some code or we can't help that much...

barneyn
05-17-2005, 10:01 AM
Hi, sorry, just thought it might be a generic problem. I'm not that good with javascript or HTML, so I'm not sure what would be helpful to show.
The below code is for adding up a total when the user clicks on a button, but as I said, it doesn't work when I publish the page to my website.

"<td align="center" width="67" height="28">
<button name="GermFreeCover_Cost" style="width: 50px; height: 25px" onclick="FP_callJS('if (OrderForm.GermFreeCover_Quantity.value&lt;10) {OrderForm.GermFreeCover_Total.value=parseFloat(OrderForm.GermFreeCover_Total.value)+parseFloat(Orde rForm.GermFreeCover_Cost.value);OrderForm.GermFreeCover_Quantity.value=parseFloat(OrderForm.GermFree Cover_Quantity.value)+1;}'); FP_callJS('string=OrderForm.GermFreeCover_Total.value;point=string.indexOf(\&quot;.\&quot;);newstring = string.substring(0, Number(point)+Number(2) + 1);OrderForm.GermFreeCover_Total.value=newstring;')" tabindex="24">
39.95</button></td> "

Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum