Solved

Passing additional parameter to $(post)

Posted on 2009-07-09
2
533 Views
Last Modified: 2013-11-08
I have a simple(stupid) question.  I'm passing along the contents of form submit via json.  I'm storing the contents in an array (params).  I want to also add an additional parameter to what I'm passing, a value that isn't part of the form.

A speedy response would be appreciated!
var params = $('form :input').serialize();
 
$.post (
  url,
  params,
  myFunction(json) {
 
}
):

Open in new window

0
Comment
Question by:aznprncritic
2 Comments
 

Author Comment

by:aznprncritic
ID: 24818904
Speedier!
0
 
LVL 16

Accepted Solution

by:
anoyes earned 300 total points
ID: 24967102
You might be able to do:

var params = $('form :input').serialize();
params=params+'newparam'='value'

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question