The one issue i have is that I need to send the current value of the input field within the post data, I know we can put it in the get data but the webservice i'm using doesn't accept this.
$("#application_add_zipCode").val() obviously won't work because it'll get the initial value of the input (i.e. empty).
I was not aware of this issue. Thanks for pointing it out. Initially I've thought, that it can be solved by closures, but it turned out differently. I need to think about the solution.
I'm using the following for ajax post and it appears to work for the most part:
url: "/services/address/lookup?max=10", //stg/prod ajaxSettings: { dataType: 'json', method: 'POST', data: { 'country': 'NL', 'postCode': $("#application_add_zipCode").val() } },
The one issue i have is that I need to send the current value of the input field within the post data, I know we can put it in the get data but the webservice i'm using doesn't accept this. $("#application_add_zipCode").val() obviously won't work because it'll get the initial value of the input (i.e. empty).
Any suggestions?