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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:21:31+00:00 2026-06-01T15:21:31+00:00

i am trying to submit a form with jQuery to a Spring MVC Controller

  • 0

i am trying to submit a form with jQuery to a Spring MVC Controller Method and load the response page in a div tag of a dialog.

jquery in dialog

$("#findbtn").click(function() {
    $("#content").load($("#searchform").submit());
});

Form

 <form id="searchform" method="POST" action="/select">
                <input type="text" id="csearch" name="csearch" /><input
                    type="button" id="findbtn" />
    </form>

Controllermethod

@RequestMapping(value = "select", method = RequestMethod.POST)
public String getSelection(Model model, @RequestParam("csearch") String find) {

    model.addAttribute("list", list);
    return "/select";
}

The Problem is that the response page is shown as a new page and not in the dialog. Is there a way to load it in the dialog.

Note: The response page (/select), happens to be the same page as the current loaded page in the dialog. That means i want to reload the content of the dialog with the same page, except the list is different.

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-06-01T15:21:32+00:00Added an answer on June 1, 2026 at 3:21 pm

    You are not using JQuery load correctly (and its not the right method for what you want to do). $.load() takes a URL, you are providing a dom element.

    There are lots of examples of “jquery ajax form submit” on the web.

    $.ajax({type:'POST', url: '/select', data:$('#searchform').serialize(), success: function(response) {
        $('#content').html(response);
    }});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to submit this form without refreshing the page. I'm using jquery;
I'm trying to do a form submit to my controller through jQuery Ajax. The
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I'm trying to stop postback on form submit if my custom jQuery validation returns
I'm trying to get the value of a form field on submit using jQuery.
I am trying to submit a form with method GET and action index.php?id=3. The
I'm trying to submit a form on an .asp page but Mechanize does not
I'm trying to submit a form to a php page that contains a WP_QUERY,
I'm trying to submit form data with jQuery. I'm using ASP.NET WebMatrix. In a
I am trying to submit a form via JQuery Mobile. I have: <form action=#pagetwo

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.