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

    Unhappy Please hlp: "onChange" in Netscape

    I have a form area on my html page (method="post"). Within that form is a default: one widget at $5.00 totals $5.00.

    It looks like a textarea with a "1" in it, followed by the word, "widget," followed by a "total" textarea with a "5" in it.

    IE uses the JS "onKeyUp," so that when the visitor types in a "2," the total instantly displays a "10" as soon as the key is typed. However, to make this work in Netscape, I have additionally included the JS "onChange" handler.

    Here's the problem: When the visitor uses Netscape 4, and they type a "2" in the textarea, the, "5" WON'T UPDATE to a "10" .... UNLESS the visitor clicks anywhere else on the page.

    What can be done to make Netscape4 do the same as Explorer?

    (by the way, many many people have not upgraded their Netscape4 yet, so that is why I need this fix)

    Thank you!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ... first thing that comes to mind is "upgrade"...
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Please help!

    I was hoping for help in this forum.

    It is easy for us, "technically oriented," "smart people," to keep up on the latest of everything. "Oh golly... Browser version 6.0323 just came out..... I better obsessively upgrade my OLD Browser version 6.0322!!"
    In the real world (based on weblogs!), MANY people are still using Netscape 4.

    For all you techy types... there is NOTHING more annoying to me than visiting someone's website where they have a "logo" that says, "Best viewed on such and such a monitor, using such and such a browser [and you should wear a hat]

    A "good" coder will make their site truly cross-platform, which I have taken the time and effort and hours to do.

    I just needed help on this one thing. Could someone possibly help, rather than point out that the whole world should upgrade?

    Thanks!
    Last edited by Noerd Joeller; 07-05-2002 at 04:36 PM.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I respectfully disagree with your definition of "good coder". In my view good coder is the one who writes standard compliant code. There are NS6.0+ Mozilla and IE 5+ (still needs some work arounds) that work with HTML4.01

    It is not about "best viewed in .... logos" it is about "HTML Valid" logo that says that you have done your job. It will also save you hours of headache and frustration.

    You can also help those who are not "technically oriented" like us to keep up with the current tecnology by providing links where they can download the latest browser versions.

    Just my 2 cents on development principles, there are a quite a few people here, that I sure will help you with your particular problem. I just offered you an advice how to avoid it all-together.

    Oh, BTW, according to The Counter, NS4.0 is used by 4% of population. It may still qualify as MANY people, but are you getting your "return on investment" here?
    Last edited by Vladdy; 07-05-2002 at 05:57 PM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Navigator supports onkeyup for text controls; onchange is working as it always does, firing after the element loses focus. Post the code that isn't working.

  • #6
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onChange

    Yes, I know onChange causes it to happen after the user "loses focus." Oh well, I guess the problems not fixable. Thank you anyway.

    I cannot believe one reply I got about "upgrading." Yes, most of us DO upgrade, but there are many people who are just learning how to click a mouse. You are in a tiny acrylic box cube of your own if you think posting links all over your page on where to "download upgrades" is going to make a consumer happy, when all the consumer wants to do is get the product ordered. People want things, and they want them now. They don't want to have to stop half way through the order to "download a new browser." Give me a break. You spent all that time philosophising instead of helping me, which is a thorn in my side when it comes to forums. "Oh lets all join hands and make the world a better place by uplifting humanity to the latest browser."

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Here's the problem: When the visitor uses Netscape 4, and they type a "2" in the textarea, the, "5" WON'T UPDATE to a "10" .... UNLESS the visitor clicks anywhere else on the page.
    Yes, I know onChange causes it to happen after the user "loses focus."
    Well...if you knew that already, why would it be a "problem"?

    I don't lecture people (generally); there's probably a sensible answer to your question, if you're interested in pursuing it dispassionately.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The "portability versus compliance" debate will never end


    Have you tried using the onKeyUp event to trigger formelement.blur() - that would fire the onchange event and cause the textarea to be updated (I guess - haven't tested it but it sounds plausible)

  • #9
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onkeyup to trigger blur! Now THAT'S the type of idea I'm looking for! Wow!..

    Okay, if you would just do one little thing.... please post the code for that.

    If you do that, I promise to hold the door open for people more often, smile more, and use, "please and thank you," more often, and in general, be a better person in life.

    -NJ

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Now i come to try it, you don't need any of that - onkeyup is enough to do the job:

    Code:
    <html><head></head><body>
    
    <script>
    
    var wObj,wVal,tObj,tVal;
    
    function calculateTotal(wObj) {
    
    	wVal = parseInt(wObj.value);
    
    	tVal = wVal * 5;
    	tObj = document.forms["widgetform"]["totalarea"];
    
    	tObj.value = tVal;
    
    	}
    
    
    </script>
    
    
    <form name="widgetform">
    <table>
    <tr>
    <td><textarea name="widgetarea" onkeyup="calculateTotal(this)">1</textarea></td>
    <td>widget : total = </td>
    <td><textarea name="totalarea">5</textarea></td>
    </tr>
    </table>
    </form>
    
    
    </body></html>


  •  

    Posting Permissions

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