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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:58:58+00:00 2026-06-09T13:58:58+00:00

I am trying to submit a form using jsRoutes in ajax after first doing

  • 0

I am trying to submit a form using jsRoutes in ajax after first doing a validation of the input using jquery form validation plugin. The problem is that when I add “data : form” to the parameters to the ajax call, the response handlers are never called. Some code to explain the issue further:

jsRoutes.controllers.Application.authenticate().ajax({
    data : {
        form : this //this messes things up!
    },
    success : function(data) {
        window.location = "/"; //never called with the above data stuff
    },
    error : function(err) {
        alert(err); //never called with the above data stuff
    }
});

I am able to read the form fields in the controller. One solution is of course to extract every field from the form manually into the data section (like below), but this is not desired. Is there any other solution?

data : {
    username : <username from form>
    password : <password from form>
},
  • 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-09T13:59:00+00:00Added an answer on June 9, 2026 at 1:59 pm

    Set an unique ID attribute for your <form> tag ie: <form id="my_form" ...> and later serialize it using the ID as a jQuery selector:

       jsRoutes.controllers.Application.authenticate().ajax({
        data : $("#my_form").serialize(),
        success : function(data) {
            // ...
        },
        error : function(err) {
            // ...
        }
    });
    

    Use some in-browser inspection tool (ie FireBug) to check if it sends what you want and if response is formatted as required

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

Sidebar

Related Questions

i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I am having two problems. First: Trying to submit this form using jquery. When
I am trying to use jquery validator plugin and form submit via ajax in
I am trying to submit a form using jQuery's .ajax() function. It seems like
I am trying to submit a form by using jquery automatically after page load
I'm trying submit some form using ajax //include jquery-1.4.2.min.js var submitForm = document.createElement(FORM); ...
I'm trying to submit a form using JQuery. My problem comes from the fact
I'm trying to submit a form when a select changes using jQuery Mobile. I
I'm trying to get the value of a form field on submit using jQuery.
I'm trying to submit form data with jQuery. I'm using ASP.NET WebMatrix. In a

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.