11 Replies Latest reply on Nov 1, 2012 7:13 AM by Darryn Campbell

    JavaScript Confirm() not working on subsequent calls or without a variable

      e just did some basic tests, and I would be very concerned with the underlying stability of the Rho Elements browser with the results from this simple test.

       

      Sample code:

      function TestConfirm()

      {

              var r = confirm("Press a button");

              if (r==true)

              {

                      x="You pressed OK!";

              }

              else

              {

                      x="You pressed Cancel!";

              }

              alert(x);

      }

       

      When I execute the function on the Rho Elements, and select OK to the Press a button confirmation box, I get the following:

      1st Run:                You pressed OK!

      2nd Run:        You pressed Cancel!

      ...                You pressed Cancel!

       

      Now, remove the capture of the variable, and simply alert the result of the confirm function

      function TestConfirm()

      {

              alert( confirm("Press a button") );

      }

      1st Run:         False

      2nd Run:        False

      ...                False

       

      With the first example, if I introduce ANY variable into the function, I always get the FALSE response.

      function TestConfirm()

      {

              var r = confirm("Press a button");

              if (r==true)

              {

                      x="You pressed OK!";

              }

              else

              {

                      x="You pressed Cancel!";

              }

              alert(x);

              var TestVar = 1;

      }

      1st Run:                You pressed Cancel!

      2nd Run:        You pressed Cancel!

      ...                You pressed Cancel!

       

      I am not sure how to proceed given these results, where I set a variable after the Confirm() prompt has been processed, and it seems to effect the result.  Any suggestions or comments would be appreciated.