If you want to send some extra data (key/values) to the server while submitting an HTML form using jQuery Ajax function then its can be achieved by appending your query string data parameter,
Code Snippet$.ajax({
url: "../server-url.php",
type: "POST",
async: true,
cache: false,
data: $('form').serialize() + "&key1="+ value1 + "&key2=" +
document.getElementById("field").value,
success : function(val){
alert("Success!");
}
});
After $('form').serialize() I have just appended the data as query String.
- How to get UTC (GMT) time using JavaScript
- Submit html form on dropdown menu value selection or change using javascript
- How to detect Browser and Operating System Name and Version using JavaScript
- JavaScript : Get current page address
- [javaScript] Convert text case to lowercase
- How to check if a String contains substring or a word using javaScript
- Writing your first Hello, World! 🌍 JavaScript code Tutorial
- JavaScript: Check if variable is a number
- How to send email from JavaScript HTML using mailto
- Meaning of javascript:void(0) explained with example
- How to get query string in JavaScript HTML location.search
- Javascript convert text case from uppercase to lowercase
- Loading previous page using html button using JavaScript
- JavaScript : Get url protocol HTTP, HTTPS, FILE or FTP
- How to get current URL Location using Javascript HTML
- Detect if Cookies are enabled using JavaScript
- Write javaScript code in Swedish using FikaScript
- Add Animated Scrolling to Html Page Title Script
- JavaScript: Convert an Image into Base64 String
- Remove items from JavaScript array
- Send Extra Data with Ajax Get or Post Request
- How to Print from JavaScript HTML using window.print
- Get Device Screen Width and Height using javaScript
- Examples: Convert String to int in JavaScript
- npm WARN saveError ENOENT: no such file or directory, open /mnt/c/package.json
- Brew Error - This command updates brew itself and does not take formula names - HowTos
- Code2care.org: A Decade of Serving the Tech Community - News
- AutoSave button not working on Office on Mac (Word, Excel or Powerpoint) - MacOS
- JSP Hello World Program Tutorial with Eclipse and Tomcat Server - Java
- Take Screenshots on Mac OS without Keyboard - Mac-OS-X
- Loading class com.mysql.jdbc.Driver. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver - Java
- List of 60 useful FTP Client Commands to access server - FTP
- The default interactive shell is now zsh. [macOS] - MacOS