Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6197125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:45:51+00:00 2026-05-24T03:45:51+00:00

I have a form to perform uploads: <%= form_tag({:controller => assets, :action => create,

  • 0

I have a form to perform uploads:

<%= form_tag({:controller => "assets", :action => "create", :id => @question.id}, :multipart => true) do %>  
    <%= label_tag("file", "Attachment:") %><%= file_field_tag "uploadfile" %><br />
    <%= label_tag("description", "Description") %><br />
    <%= text_area_tag("description",{}, :size => "70x6") %>
    <%= submit_tag("Upload", :class => "register_submit_buttons") %> 
<% end %>

The form submits perfectly, and the file begins to upload to amazon s3. What i would like to do is to trigger a jquery ui dialog box to open when upload begins(the moment i click submit on the form) and then close it when the upload has been completed. I already know how to open a dialog when triggered by a link like this:

link to my dialog div:

<%= link_to("Open dialog", {}, :class => "open-dialog") %>

the dialog div:

<div class="dialog" title="Title">
    ...contents of div
</div>

and finally in my application.js

$(function() {
    $( '.dialog' ).dialog({
        autoOpen: false,
        width: 530,
        modal: true,
        //closeOnEscape: false,
    });
    $('.open-dialog').click(function(){
        $('.dialog').dialog('open');
        return false;
    });
});

As you can see most of the stuff is pretty standard from jquery ui website. I would also like to add a button to the dialog box to cancel the upload. How can i achieve this?

Thanks in advance for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:45:52+00:00Added an answer on May 24, 2026 at 3:45 am

    you can use the jQuery submit() listener for the form – this will fire when the form is submitted (and presumably when the upload starts).

    eg:

    $('form').submit(function(){
        //show box in here
        alert('lorem ipsum dolor sit amet');
    });
    

    EDIT:

    Not sure about how to cancel the upload though, sorry.
    But you might get some enlightenment from here: http://aquantum-demo.appspot.com/file-upload

    jQuery submit(); docs: http://api.jquery.com/submit/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a form button in the form,which i need to perform basic action
i have form action file in another directory but some file send to this
I have a form on an HTML page with multiple submit buttons that perform
I have a form and I'm trying to perform Ajax posts. With the default
I have Windows Form.Now i want to perform some function when the form get
I have a very large 60+ question form that the user can start to
I have a HTML form ( upload.htm ) with a HTML file upload control
i have a form holding a button that, when clicked, needs to perform the
I currently have a form that I am trying to perform a post on
I have a file upload web-form on the website and it needs to only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.