Hi guys,
I have a fileupload template and I would like to show a .gif picture
during the upload process once the user submits a file to upload, it's
working already but .gif is not animated while waiting for fileupload
completion. On the other hand, if I include a frame in the form action
call, the gif gets animated but it doesn't go further to the
upload_success template, I mean it stays showing the ...loading
withthe animated .gif forever.
here is the piece of the template (like this it stays showing the
animated .gif forever):
<script language="javascript" type="text/javascript">
<!--
function startUpload(){
document.getElementById('f1_upload_process').style.visibility =
'visible';
document.getElementById('f1_upload_form').style.visibility =
'hidden';
return true;
}
//-->
</script>
[...]
<div id="content">
<form action="." method="post" enctype="multipart/form-
data" name="zip_file" target="upload_target" onsubmit="startUpload();"
>
{% if not is_ok %}
<div id="volver_ini"><label> {{ msg }} </
label></div>
{% else %}
<br>
{% endif %}
<p id="upload_process">Cargando...<br><img src="/
media/img/admin/loader.gif" ><br></p>
<p id="upload_form" align="center">
<br>
<table>
{{ form }}
</table>
<label>
<input type="submit" name="submitBtn"
class="sbtn" value="Enviar" >
</label>
<iframe id="upload_target" name="upload_target"
src="#" style="width:0;height:0;border:0px solid #fff;"></iframe>
</p>
Then I have my view from what I'm calling the template, as I said
everything works (with unanimated loader.gif if I don't include the
target parameter inside the form action line. Without the target, as
soon as it finishes uploading goes to POST and executes the django
view.
I would like to know if this approach is valid, I mean if I can
combine calling a frametarget and going to my django view after the
process has been completed. if not How can I show the animated .gif ??
Thanks a lot in advance
Vince
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---