Welcome Guest, Not a member yet? Register   Sign In
loading message
#1

[eluser]atoleon[/eluser]
Hi

I have a page where the users can upload images. For that, i use a simple form with a field input type="file" and it call the method upload wich use de class upload from codeigniter.
It works fine, so... to do this, the system may take a few seconds wich the page may seems like it dont work.
Is posible show a loading message while the image is been uploaded???

Im trying use jquery but i have not get it works. I have to say i haven't got knowledge of javascript.

thank you very much
#2

[eluser]Deveron[/eluser]
Hi atoleon,

this solution should work for you.

jQuery
Code:
$().ready(function(){
            
   // On click on the submit button remove the "hidden" class
   // to make the div with the message visible
   $('#submit_field').click(function(){
       $('#submit_message').removeClass('hidden');
   });
              
});

HTML - Body
Code:
<?=form_open_multipart('')?>
    <input type="file" name="file" />
    <input type="submit" id="submit_field"/>
</form>
        
<div class="hidden" id="submit_message">
    Uploading...
</div>
#3

[eluser]atoleon[/eluser]
i've tried it and it works very nice. Thank you very very much.




Theme © iAndrew 2016 - Forum software by © MyBB