I am trying to ad the values from 2 form elements into a function and can get the first to add but can’t work out the correct way to code for the second.
$(function() {
$('#form_orderTracking').click(function(){
$('#CustomerDetails').load('TrackOrder1.asp?OrderID=' + $('#orderID').val());
});
});
I am trying to add the value for the emailAddress field so that the url reads:
TrackOrder1?OrderID=123456&EmailAddress=abc@123.com
Instead of appending the query string to the url, you can pass it to
.loadas a 2nd parameter. If you pass an object, it’ll usePOST, if you pass a string, it’ll useGET(like your example).$.paramconverts the object to a string, so it usesGET.Or you can just append to your string, like so: