Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Javascript on Frontpage forms

    Hi all,

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

    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.

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    post some code or we can't help that much...

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by barneyn; 05-17-2005 at 10:08 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •