0

I am using this code for sending data to controller, but i want to pass one more parameter say birthDate how can I pass it using below syntax ???

jQuery("#patient").jqGrid('setGridParam', {url : "totalPatientList.html?pid=" + $('#byId').val()});

plz help me soon....

Balkrushn
  • 91
  • 1
  • 1
  • 12

1 Answers1

0

This should work

jQuery("#patient").jqGrid('setGridParam', {url : "totalPatientList.html?pid=" + $('#byId').val() +"&birthDate="+$("#birthDateId").val() });
Anshu
  • 7,783
  • 5
  • 31
  • 41
  • @balkrushn: I would recommend you to use `url: "totalPatientList.html", postData: { pid: function () { return $('#byId').val(); }, birthDate: function () { return $("#birthDateId").val(); }}`. In the case the functions will be called on every request to the server and you will have **the current** values be sent. See [the answer](http://stackoverflow.com/a/2928819/315935) for more details. If you would do prefer direct encoding of parameters in URL you should use `encodeURIComponent($("#birthDateId").val())` instead of `$("#birthDateId").val()`. – Oleg Oct 07 '12 at 09:03