简体   繁体   中英

Is there any way to stay on same bootstrap modal after submitting the form?

<form id="upload_form" method="post" action="uploadfile.asp">
                <div class="row">
                    <input type="file" name="file" id="file" accept=".csv,.xls"/></span>    
                    <input type="submit" value="submit">
                </div>             
</form>

This form is on bootstrap modal.

uploadfiles.asp, I am using FreeASPUpload class that I got from internet.

if Upload.UploadedFiles.Count = 1 Then

Response.redirect("/admin/login_list_import.asp?file_upload=1-0")

else

Response.write("No files sent or only one file required. Script is OK!<br>") ' Say to Flash that script exists and can receive files

End IF

when I submit the form it redirect me to login_list_import.asp page.

I want to stay on the same modal after submitting the form. Is there any way to do this?

I think when you are redirected to the page

login_list_import.asp?file_upload=1-0

using the same condition (file_upload=1-0), you can manually fire the js code to open the modal window on page load

For example

<%
if Request.Querystring("file_upload")="1-0" then
%>

  <script type='text/javascript'>

     $( document ).ready(function() {
        $('#divmodal').modal('show');
     });

  </script>

<%
end if
%>

通过Ajax-Request发送Formdata。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM