Web Analytics Made Easy -
StatCounter Please hlp: "onChange" in Netscape - CodingForum

Announcement

Collapse
No announcement yet.

Please hlp: "onChange" in Netscape

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    ... 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"

    Comment


    • #3
      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; Jul 5, 2002, 11:36 AM.

      Comment


      • #4
        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; Jul 5, 2002, 12: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"

        Comment


        • #5
          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.

          Comment


          • #6
            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."

            Comment


            • #7
              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.

              Comment


              • #8
                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)
                "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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>
                    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

                    Comment

                    Working...
                    X