Maybe a little more code sharing.

Back buttons and double click can really screw things up. I know its been posted here a few time and there are tons of stuff out there addressing the problem. I'm sure I did not invent this, but I dreamed up a solution that takes three lines of javascript (not counting the prototype simulation). The technique takes care of both the back back button and the double click.

I love CSS style display:none! The snippet below should actually work, even thought there is no form or html tags. I have two div's. One contains the "Action" buttons. The other one is marked as display:none and contains a message that the transaction is processing. Clicking on the submit button (optionally) calls your validate method and at the end, sets the "Action" div to display:none and the "Transaction" div to display:block. The first click stops the submit button from double clicking. Using the back button, the user is faced with a yellow box and no buttons!

Steve Alex

<script type="text/javascript" charset="utf-8">
        function validateMe(form){
                //optional call to validate
                $("actionbar").style.display = "none";
                $("transactionbar").style.display = "block";
                return true;
        }
        function $(element) {  //two line prototype $() simulation
          element = document.getElementById(element);
          return element;
        }
</script>

<input type="text" name="some_name" value="" id="some_name">
<input type="text" name="some_name1" value="" id="some_name1">
<div id="actionbar" class="wide-bar" style="border:4px solid blue">Actions: <input type="submit" value="submit" value="submit" onclick=" return validateMe(this)">
</div>
<div id="transactionbar" style="display:none;border:4px solid yellow;text-align:center;font-size:1.5em" > <p style="margin:2px">Transaction Processing (or Proceessed) - Please Wait</p>
</div>



_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to