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 3340322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:35:40+00:00 2026-05-18T00:35:40+00:00

I’m developing an web application using asp.net MVC and jQuery. I have in my

  • 0

I’m developing an web application using asp.net MVC and jQuery. I have in my page 10 forms and I’m using jQuery (live events) to do a async submit them. Something like this:

Everything works fine, but I need to format a Div with an image and when user clicks on this div I need to submit the form, but… the form is not executing the async operation like the submit button. It’s executing default behavior…

My div is something like this:

My Script:

$("#jobs form").live('submit', function() {
   $.post($(this).attb('action'), $(this).serialize(), function(result) {
     //get and format result in my content divs...
   });
});

My HTML:

<div id="jobs">
<% foreach(var job in Model) { %>
<form ...>
  <!-- hide this button -->
  <input type='submit' class='hide' id='mysubmitButton_<%=job.Id%>' />
  <!-- need to submit this form -->
  <div class='buttonImage' onclick="$('#mysubmitButton_<%=job.Id%>').click();"></div>
</form>
<% } %>
</div>

How can I set in ‘onclick’ to do a assync submit like the Submit Button in my page?

I don’t know how to format this button, So I’m using an div or a hyperlink…

Thanks

  • 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-18T00:35:40+00:00Added an answer on May 18, 2026 at 12:35 am

    Firstly, you have $.post($(this).attb('action'), .... This won’t work — the function is attr, so you need $.post($(this).attr('action'), .... Even better would be to avoid the jQuery object and use $.post(this.action, ....

    For your submit image, the following code should work:

    $('.buttonImage').live('click', function(){
        $(this).closest('form').submit();
    });
    

    This will find the parent form and call the submit action on it, which should trigger the handler you defined in your question.

    Just to note that it doesn’t appear that you are preventing the default action occuring. You need to call your live method on the form like this:

    $("#jobs form").live('submit', function(e) {
        e.preventDefault();
        // do the rest of your code
    }
    

    This prevents the default submit action occuring.

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

Sidebar

Related Questions

No related questions found

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.