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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:42:13+00:00 2026-05-31T06:42:13+00:00

When I submit my form, I want get a success when success the form.

  • 0

When I submit my form, I want get a success when success the form. I’m using jquery ujs

$('#new_invitation').submit(function(e)  {
 var $this = $(this);
 $this.on('ajax:success', function(e) {
  alert ('Success');
 });
});

The alert with Success is not fired :(.

Why?

  • 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-31T06:42:15+00:00Added an answer on May 31, 2026 at 6:42 am

    how are you doing? It seems to me that you are not actually submitting your form using AJAX since The submit() function will trigger the normal submission of the form. Can you try this code?

    $('#new_invitation').live('submit', function(event){
      event.preventDefault(); //Stops the normal form submission process
      form = $(this);
      data = form.serialize(); //serializes the form data
      jQuery.ajax({
        type: 'POST',
        dataType: 'JSON', // JSON, HTML, whatever your API responds to
        url: form.attr('action'), //fetches the URL from the form
        success: function(data,textStatus,jqXHR){
          //Success callback
          alert('success');
        }
      });
    });
    

    This assuming the ‘#new_invitation’ is the ID of the form tag. I recommend you take a look at the jQuery docs site, they have a wealth of information about AJAX: http://api.jquery.com/jQuery.post/

    Good luck!

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

Sidebar

Related Questions

I am using jQuery to submit my form via AJAX. This updates a database
I want to submit a form without page refresh using jQuery. I found some
I have a jquery Ajax call function that I use to submit form to
I am using jquery validate with a form. I want to submit the form
I have this js.... $(#form).submit(function(){ var answerlist = first; var answerlist = answerlist +
I have a case where i want to submit a form and get the
i want to submit a form using Ext.Direct and iam following all the guidelines
I want to submit a form like this: <input type=button onclick=$('#form1').submit(); value=Create /> but
I want to submit a form that have many checkboxes with different values, using
I'm using the JQuery Form Plugin ( http://jquery.malsup.com/form/ ) to create an Ajax Form.

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.