1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

FireFox Problem - JavaScript OnChange

Discussion in 'JavaScript' started by Supergrover1981, Sep 25, 2006.

  1. #1
    Gidday Gang,

    I'm currently trying to make a simple price calculator for a web page. It works like this:

    - A visitor enters a quantity of each product they desire in a text input box

    - A read-only input box then displays the subtotal for that item(trigged by ONCHANGE of the quantity text box)

    - A read-only input box displays the total for all items (triggered by the ONCHANGE of the quantity text box)


    The calculator works fine in Internet Explorer, but the subtotal/total boxes don't display anything at all in Firefox. Page can be seen at http://www.johnbayne.com/hc15/orderformbeta3.html

    If anyone has any suggestions at all for this problem, I'd be most appreciative.

    Cheers gang,
    - JB
     
    Supergrover1981, Sep 25, 2006 IP
  2. dalziel

    dalziel Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know if you've changed it since you posted this, but it seems to be working fine in FF 1.5.0.7
     
    dalziel, Sep 26, 2006 IP
  3. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi!

    Don't use the on* attributes. Scripting and page structure should be kept separate.

    Instead, you can use event listeners, which can be attached purely through JS. You may want to download and use my two wrapper functions for this which iron out a slight browser incompatibility.

    Search for addEventListener for information on how it works.

    Regards
    - P
     
    penagate, Sep 27, 2006 IP
  4. FFH

    FFH Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey Mate, did you turn on "enable Javascript" and "enable Java" in the browser you were testing with? Sometime its simpler than it seems to be.

    Cheers

    FFH
     
    FFH, Oct 23, 2007 IP