Hourglass on form feed

I have a grails application that parses a CSV file. I have work with the form, and when people upload the form, it can take 30 seconds, plus get the next page, during which only a discerning or extra strong observer will notice that the page is "waiting for an answer from".

Is there a quick way to add some kind of popup or hourglass or something with javascript (maybe jQuery) without changing the mechanics of the form? I am looking for a quick fix WITHOUT migrating the entire form view in jQuery or something like that.

In my initial attempts, the answer seems to be no. When the normal submit form is clicked, the browser seems to have launched the page by disabling javascript. However, if the answer is the SAME PAGES, javascript will be executed then, but that does not help me.

Something like that:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">jQuery(function(){
  alert("jquery aint buggeed");  //this happens
  $("#submitHandle4JQ").click(function(){alert("BE PATIENT!!");})  //this does not
}); </script>

...

<form action="/path/mySweetGrailsController/parseStuff" method="post" enctype="multipart/form-data" >
<input type="hidden" name="longNumber" value="935762708000464097" id="longNumber" /> 
<input type="file" name="bigFile" />
<input type="submit" text="Upload My File" name="submitHandle4JQ"/><br/>
</form>
+3
source share
2 answers

Try it. When your form is being processed, add the class "Waiting" to the body, and then:

<style type="text/css">
.waiting { cursor: wait; }
</style>

, , (, "wait" ), , , ( XP , Windows 7, Mac OS ..). :

http://reference.sitepoint.com/css/cursor

, , .

: , , , .

+6

jQuery, , BlockUI . . HTML, , HTML. , - , . BlockUI form.submit.

http://jquery.malsup.com/block/

+2

All Articles