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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mac IE 5.5 button onClick issue

    Hi,

    I have a javascript calculator and it doesn't want to work properly on Mac IE 5.5 It will work on Netscape 7 and is fine on PC IE 6 etc.

    Here is my code, I am wondering is there any other method for calling this javascript for the form?

    <input name="Button3" type="button" class="buttonblue" value="Calculate" onClick="multiplyMonthlyCost(this.form)">

    Thanks for any help, as I don't want to have to do a browser detect and go and get Netscape message.

    Cheers,

    Greg

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Firstly, there is no such browser as IE5.5 for Mac. IE/Mac never got any higher than 5.2.3.


    -

    Without seeing the rest of the javascript as well as the rest of the form markup, it's hard to say for sure.

    this.form refers to a form element or attribute within that input element, of which there are none (naturally).

    If there is only one form on the page, you could try…
    Code:
    onClick="multiplyMonthlyCost(document.forms[0])"
    If the form has an id attribute, you could try…
    [code]
    Code:
    onClick="multiplyMonthlyCost(document.forms['formId'])"
    (where formId is the id of that form)

    …but, as said, without seeing the larger context, it's hard to know the most appropriate way to pass the relevant info to the multiplyMonthlyCost() function.
    Last edited by Bill Posters; 07-06-2005 at 09:49 AM.

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    400
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Bill Posters
    this.form refers to a form element or attribute within that input element, of which there are none (naturally).
    Actually, this.form refers the input's ancestral from. Rather that having to go through a chain of .parentNode and tests for .nodeName=='FORM', .form gives a direct reference. It's the complement to form's .elements object, and is a very handy way to abstract a function for use with multiple forms.

    gtgart -- like Bill said, we'd need to the code for multiplyMonthlyCost (and any subroutines it uses), plus the HTML for the entire form.

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by Harry Armadillo
    Actually, this.form refers the input's ancestral from. Rather that having to go through a chain of .parentNode and tests for .nodeName=='FORM', .form gives a direct reference. It's the complement to form's .elements object, and is a very handy way to abstract a function for use with multiple forms.

    gtgart -- like Bill said, we'd need to the code for multiplyMonthlyCost (and any subroutines it uses), plus the HTML for the entire form.
    tbh, as I wrote it, I half expected someone to chime in and fill in what turns out to be a gap in my knowledge.
    I happily stand (sit) corrected.

    …which is not to say that I totally understood your correction, but I'll read it again (and possibly again) until I geddit.
    Last edited by Bill Posters; 07-06-2005 at 11:12 AM.

  • #5
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Bill Posters
    tbh, as I wrote it, I half expected someone to chime in and fill in what turns out to be a gap in my knowledge.
    I happily stand (sit) corrected.

    …which is not to say that I totally understood your correction, but I'll read it again (and possibly again) until I geddit.
    I take your point on Mac IE 5.2.3, and please find the page code attached.

    Greg.
    Attached Files Attached Files

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,047
    Thanks
    0
    Thanked 251 Times in 247 Posts
    The source of the problem could be the toFixed() method. I think IE/Mac doesn't support it and it is buggy in IE5.5/Win. Use liorean's toDecimal() method instead.


  •  

    Posting Permissions

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