Loading ...
Sorry, an error occurred while loading the content.

Re: [JavaScript] alert button

Expand Messages
  • David Smart
    I think we ll probably need more of your html and code to see what s going on here - probably best to copy in the lot. However, the first thing I look for with
    Message 1 of 5 , Dec 31, 2002
    • 0 Attachment
      I think we'll probably need more of your html and code to see what's going on here - probably best to copy in the lot.

      However, the first thing I look for with stack overflow situations is inadvertent recursive calls. I'd be starting off by putting an alert at the beginning of your checkForm routine so that you can see if it's called more than once.

      I'm also a bit uneasy about the fact that your "success" code seems to be in one side of an if statement, but you have an unconditional "return true" in the main flow of the routine. You only want to return true if the validation was OK. Your unconditional return should presumably return false, or a computed "success" value.

      Regards, David Smart

      SmartWare Consulting
      smartware@...
      http://members.optushome.com.au/smartware/

      ----- Original Message -----
      From: yiplx <yiplx@...>
      To: javascript_official@yahoogroups.com
      Sent: Wednesday, January 01, 2003 10:27 AM
      Subject: [JavaScript] alert button


      Hi All,
      I'm new to javascript and I have a problem. I'm trying to create an
      alert which will summerize an order form. I'm not sure where and how
      to put the alert code. Below is a part of my code.... When I tired
      to put the alert inside the function I get an error "Stack is full".
      I'm thinking it might be something to do with my form tag. Any help
      would be appreciated. Thanks in advance.


      // This part is within my checkForm function

      else
      { var a,b,c,d,e,f;
      prc1.value = formatCurrency((4.50*quan1.value));
      prc2.value = formatCurrency((6.25*quan2.value));
      prc3.value = formatCurrency((5.25*quan3.value));
      prc4.value = formatCurrency((6.50*quan4.value));
      prc5.value = formatCurrency((2.35*quan5.value));
      a = parseFloat(prc1.value)
      b = parseFloat(prc2.value)
      c = parseFloat(prc3.value)
      d = parseFloat(prc4.value)
      e = parseFloat(prc5.value)
      subt.value = formatCurrency(a+b+c+d+e);
      tax.value = formatCurrency(subt.value*0.05);
      f = parseFloat(tax.value)
      total.value = (a+b+c+d+e+f);
      }
      } // end with
      return true;



      } //end checkForm function


      <form name = 'form1' method='get' action='formValidated.htm' onsubmit
      = 'return checkForm()'>


      Yahoo! Groups Sponsor
      ADVERTISEMENT




      To unsubscribe from this group, send an email to:
      javascript_official-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


      [Non-text portions of this message have been removed]
    • Francisco Morosini
      Hi, i try this code for each 3 seconds call js functions: varqq=9; function changeopx() { if
      Message 2 of 5 , Jun 18, 2003
      • 0 Attachment
        Hi, i try this code for each 3 seconds call js functions:

        <script language="JavaScript" type="text/javascript">
        varqq=9;
        function changeopx()
        {
        if (!document.images)
        return
        up(varqq);
        varqq++;
        }
        function changeopt()
        {
        if (!document.images)
        return
        dn(varqq);
        varqq++;
        window.setTimeOut("changeopx()",1000);
        }
        </script>
        <script language="JavaScript" type="text/javascript">
        changeopt();
        </script>

        but the IE send me an expect object in the line where i use setTimeOut, what
        is my mistake?

        thanks for any help

        With Best Regards

        :: Francisco Javier Morosini Eguren


        ---
        Outgoing mail is certified Virus Free.
        Checked by AVG anti-virus system (http://www.grisoft.com).
        Version: 6.0.490 / Virus Database: 289 - Release Date: 16/06/2003
      • shortestpath
        what are up() and dn() ?? ... Hi, i try this code for each 3 seconds call js functions: varqq=9; function
        Message 3 of 5 , Jun 19, 2003
        • 0 Attachment
          what are up() and dn() ??


          --- Francisco Morosini <fmorosini@...> wrote:
          Hi, i try this code for each 3 seconds call js functions:

          <script language="JavaScript" type="text/javascript">
          varqq=9;
          function changeopx()
          {
          if (!document.images)
          return
          up(varqq);
          varqq++;
          }
          function changeopt()
          {
          if (!document.images)
          return
          dn(varqq);
          varqq++;
          window.setTimeOut("changeopx()",1000);
          }
          </script>
          <script language="JavaScript" type="text/javascript">
          changeopt();
          </script>

          but the IE send me an expect object in the line where i use setTimeOut,

          what
          is my mistake?

          thanks for any help

          With Best Regards

          :: Francisco Javier Morosini Eguren

          __________________________________
          Do you Yahoo!?
          SBC Yahoo! DSL - Now only $29.95 per month!
          http://sbc.yahoo.com
        • Kenneth Bull
          use setTimeout, not setTimeOut (capitalization). ... Date: Wed, 18 Jun 2003 23:51:34 -0500 From: Francisco Morosini Subject: running
          Message 4 of 5 , Jun 19, 2003
          • 0 Attachment
            use setTimeout, not setTimeOut (capitalization).

            ----------------------------------------------------------------------------------
            Date: Wed, 18 Jun 2003 23:51:34 -0500
            From: "Francisco Morosini" <fmorosini@...>
            Subject: running functions in intervals

            Hi, i try this code for each 3 seconds call js functions:

            <script language="JavaScript" type="text/javascript">
            varqq=9;
            function changeopx()
            {
            if (!document.images)
            return
            up(varqq);
            varqq++;
            }
            function changeopt()
            {
            if (!document.images)
            return
            dn(varqq);
            varqq++;
            window.setTimeOut("changeopx()",1000);
            }
            </script>
            <script language="JavaScript" type="text/javascript">
            changeopt();
            </script>

            but the IE send me an expect object in the line where i use setTimeOut, what
            is my mistake?

            thanks for any help

            With Best Regards

            :: Francisco Javier Morosini Eguren


            ---
            Outgoing mail is certified Virus Free.
            Checked by AVG anti-virus system (http://www.grisoft.com).
            Version: 6.0.490 / Virus Database: 289 - Release Date: 16/06/2003






            ---------------------------------
            Post your free ad now! Yahoo! Canada Personals


            [Non-text portions of this message have been removed]
          • Garvin Casimir
            a function will stop executing at whatever point you put a return statement in it. function do_this(){ action 1........ return action 2.... } it wont execute
            Message 5 of 5 , Jun 20, 2003
            • 0 Attachment
              a function will stop executing at whatever point you
              put a return statement in it.

              function do_this(){

              action 1........

              return

              action 2....

              }

              it wont execute action 2


              it is useful with if statements...but you have it at
              the beginning of the if statement so it aint executing
              the rest of the if...


              --- Francisco Morosini <fmorosini@...> wrote:
              > Hi, i try this code for each 3 seconds call js
              > functions:
              >
              > <script language="JavaScript"
              > type="text/javascript">
              > varqq=9;
              > function changeopx()
              > {
              > if (!document.images)
              > return
              > up(varqq);
              > varqq++;
              > }
              > function changeopt()
              > {
              > if (!document.images)
              > return
              > dn(varqq);
              > varqq++;
              > window.setTimeOut("changeopx()",1000);
              > }
              > </script>
              > <script language="JavaScript"
              > type="text/javascript">
              > changeopt();
              > </script>
              >
              > but the IE send me an expect object in the line
              > where i use setTimeOut, what
              > is my mistake?
              >
              > thanks for any help
              >
              > With Best Regards
              >
              > :: Francisco Javier Morosini Eguren
              >
              >
              > ---
              > Outgoing mail is certified Virus Free.
              > Checked by AVG anti-virus system
              > (http://www.grisoft.com).
              > Version: 6.0.490 / Virus Database: 289 - Release
              > Date: 16/06/2003
              >
              >
              > ------------------------ Yahoo! Groups Sponsor
              >
              > To unsubscribe from this group, send an email to:
              > javascript_official-unsubscribe@yahoogroups.com
              >
              >
              >
              > Your use of Yahoo! Groups is subject to
              > http://docs.yahoo.com/info/terms/
              >
              >


              =====
              HTTP://SILASCO.PORT5.COM/TONES/

              __________________________________
              Do you Yahoo!?
              SBC Yahoo! DSL - Now only $29.95 per month!
              http://sbc.yahoo.com
            Your message has been successfully submitted and would be delivered to recipients shortly.