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

  • Home
  • SEARCH
  • 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 6475569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:43:12+00:00 2026-05-25T06:43:12+00:00

I want to submit a form using jquery .post() . I want to send

  • 0

I want to submit a form using jquery .post(). I want to send all the input names in addition to another parameter, in there any way to send data and the request?

 $.post("RegistrarManagementServlet",{"option":"cancelRequest"},function(){
                alert("hi");
            });

here is how we submit the request

  $.post("RegistrarManagementServlet",request,function(){
                alert("hi");
            });

I want to send all the data in the form (in the normal post request) in addition to option parameter, how can I make it?

EDIT

where should I define the request as function parameter, since the code occurs after confirmation dialog appear

$('#cancelRequest').click(function(event){
    event.preventDefault();
    jConfirm('Are you sure to delete registrar request?', 'Confirmation Dialog', function(result) {

        if(result == true){
            request.cancelRequest="cancelRequest";   //request is not defiend
            $.post("RegistrarManagementServlet",request,function(){
                alert("hi");
            });
          }

    });
  • 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-25T06:43:12+00:00Added an answer on May 25, 2026 at 6:43 am

    You can make name value pair by using following code

     var elem = document.getElementById('frmName').elements;
     for(var i = 0; i < elem.length; i++)
       {
          //Make the pairs like 
            //{"option":"cancelRequest"}
          //elem[i].name will give you the name and
          //elem[i].value will give you the value of the field           
       }
    

    then post your request just the way you do.

    Or you can see the example at
    http://www.codeunit.co.za/2009/11/04/jquery-iterate-through-a-forms-elements/
    for a Jquery way to do the same

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

Sidebar

Related Questions

I would like to use jQuery.ajax to submit a form using POST without having
I am using Jquery AJAX to post a form on my page. I want
I am using jquery validate with a form. I want to submit the form
I am using html, javascript & mod_python. I want to submit html form. To
I want to submit a form like this: <input type=button onclick=$('#form1').submit(); value=Create /> but
I built contact form in aspx 3.5 and I'm using jQuery to send it
i'm using jquery tabs.. i'm use tabs-1 as input form and tabs-2 as show
I'm using the jQuery disable submit method to prevent double posts of my form
I want to prevent a form from being submitted using jQuery and instead run
I have a very simple scenario where I want to POST the form using

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.