• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Please Wait Script

Enthusiast ,
Sep 07, 2009 Sep 07, 2009

Copy link to clipboard

Copied

I have a payment script which processes credit cards through PayPal, they say that it can take as long as 30 seconds to process the payment, which leaves the end user hanging.

I need a script that displays a 'Please Wait - Your order is being processed" in the middle of the screen.

Would anybody happen to have anything off the shelf that I could use? If it uses any server side code, it must run on a CF7 server

Thanks

Mark

TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 07, 2009 Sep 07, 2009

Copy link to clipboard

Copied

The simplest ways are to use Cold Fusion.

Method 1 - Intermediate page.  The intermediate page collects the user input, usually from a form.  It converts those variables to session variables displays something, and cflocates to the next page.

Method 2 - cfflush.

Method 1 probably meets your requirements more than method 2.

You can also do it with javascript, but using cf is more reliable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

Thanks for the reply Dan, I was just about to post myself to say that I had found a solution, a simple little script that works real well. The only thing I can't seem to do with it is add more than one line of text without it leaving a huge gap between the two lines, but that's not the end of the world.

This script puts a please waiting on top of the existing submit page and it does not disappear until the next page is ready to be displayed, which also helps by not allowing them access to the submit button

Here's the code, I'm sure somebody else will also find this valuable:

<script type="text/javascript">
var ray={
ajax:function(st)
    {
        this.show('load');
    },
show:function(el)
    {
        this.getID(el).style.display='';
    },
getID:function(el)
    {
        return document.getElementById(el);
    }
}
</script>


<style type="text/css">
#load{
position:absolute;
z-index:1;
border:13px double #000000;
background:#ff8400;
width:700px;
height:300px;
margin-top:-150px;
margin-left:-150px;
top:50%;
left:35%;
text-align:center;
line-height:300px;
font-family:"Trebuchet MS", verdana, arial,tahoma;
font-size:18pt;
color:ffffff;
}
</style>

<div id="load" style="display:none;">Processing... Please wait. May take up to 30 seconds</div>

You then just have to make sure you have ONSUBMIT in the form


<form action="YOUR NEXT PAGE.cfm" method="post" onsubmit="return ray.ajax()">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

LATEST

We do something similar but it is not 100% reliable.  Where it falls down is if the user navigates to another window or tab and then comes back.  The display is gone and it's possible to re-submit the request.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation