When I click on the submit button "input type="submit" id="submit" value="Save"". it starts uploading a file that I selected from my hard disk. this all doesnt matter though, because I made a div with the text "uploading" and the style of that div is visibility:hidden; now what I want is that when I click on the submit button (the time when the file starts uploading) that the div becomes visible, I've tried several things including " How can I display a status message while a file is uploading? " but no luck, could be just me but I am fairly new to jQuery so I would appreciate some help.
Thanks
EDIT: I tried the all the codes below, but nothing worked, I also tried
$('#editform').submit(function() {
$('#loadingdiv').show();
return true;
});
(editform being the form ID that I'm working in) but no luck, does anyone know why this is happening?
My whole edit page below
@using (Html.BeginForm("Edit", "Admin",FormMethod.Post, new { enctype = multipart/form-data", id = "editform" })){
@Html.EditorForModel()
<div class="editor-field">
@if (Model.ImageData == null)
{
@:None
}
else
{
<img width="150" height="150"
src="@Url.Action("GetImage", "Product", new { Model.ProductID })" alt="bic boii" />
}
<div>
Upload nieuw image:
<input type="file" name="Image" />
</div>
</div>
<div>
Upload nieuw document:
<input type="file" name="Pdf" />
</div>
<script type="text/javascript">
$('#editform').submit(function() {
$('#loadingdiv').show();
return true;
});
</script>
<input type="submit" id="submit" value="Opslaan" />
@Html.ActionLink("Ga terug", "Index")
<div id="loadingdiv">
Bezig met uploaden.
</div>}
hmm, after putting a breakpoint on my form, it just skips my script completely, I'm not sure what that is about