• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2437
  • Last Modified:

How to show loading page after clicking submit button?

Hello all,
 Maybe my topic is not right but I didn't know how could I describe it with a short sentence.
 What I would like to have ;

 I have got a normal order form, once member will click submit button;

 1. The Submit button name should change to Submit -> Processing...
 2. A new transparent page should appear and show loading image and I also would like to write some text.
 3. The page somehow should be protected from refreshing. Since the order will be delivered automaticly (taking the items from database and delivering).

 If page will refresh because of refreshing, database may deliver x2 - x3 more items, or wont deliver any items at all because it will find an error.
 
 I also would like to know if following wish is possible;
 New transparent page (layer) will do all process and when it is done, it will write;

 "Your order has been delivered. Click here to view your order"

 Thank you for your time and help.

Best regards,

 Thank you for your help and time.
0
pixalax
Asked:
pixalax
  • 5
  • 4
1 Solution
 
GawaiCommented:
for Q 1 and 3
function validateFrm(){
document.processFrm.Process.disabled=true;
   document.processFrm.Process.value='Please Wait';
   document.processFrm.submit();
   return true;
}
 
<FORM NAME="processFrm" ACTION="process.asp" METHOD="post" onsubmit="return validateFrm()">
 
..
..
<INPUT id="Process" name="Process" type="submit"  value="Submit">

Open in new window

0
 
scrathcyboyCommented:
You have to do this BEFORE you submit the form.  Use java script to submit the form, not the SUBMIT in the FORM tag, and just before you do the javascript submit, you write text or an image to a SPAN tag on the page (I do this all the time, so I know it works) -- but when the form submits, then the page WILL refresh.

"The page somehow should be protected from refreshing."

Can't do this easily.  You simply tell the user what has happened, an error, or the submit went through.  The whole point of a form is to tell the user that the action succeeded or did not, isn't the user entitled to know that his effort in your page got some results?

I think you need to rethink your logic.  Say you gave your CC info, name and address to some web page in good faith, and then it just siezed on you -- you would be ripped, and suspect them of fraud, right?
0
 
pixalaxAuthor Commented:
There is nothing about paying money in this page. It is just taking some points from user's point in order to deliver the electronic items but still it will be better with higher security, all I want is ;
1. Proccessing... Please wait. text
2. User won't be able to refresh the page
3. Submit button should be pressed 2nd time.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
GawaiCommented:
did u try above code ?
0
 
pixalaxAuthor Commented:
I tried thank you but, still I need some kind of layer showing up :(
Like when you try to delete the question a layer shows up, (transparent white page for example you can't click anything, just processing... please wait text and image I would like to put :)
0
 
GawaiCommented:
0
 
pixalaxAuthor Commented:
Thank you for your answers and time.
What should I do now?
All answers are the solution some how? I am new here guys, sorry.
0
 
GawaiCommented:
last one would be nice
0
 
pixalaxAuthor Commented:
Thank you..
Sorry for delay, just had too much work to do nowadays.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now