I have 2 selectable option values for a keywords field ie Search for Keywords Option(int)1 or Name. option int(2)
I need to pass this addition option value along with the $q query to the search form.
How do i do this?
Thanks
I have 2 selectable option values for a keywords field ie Search for Keywords Option(int)1 or Name. option int(2)
I need to pass this addition option value along with the $q query to the search form.
How do i do this?
Thanks
use the extraParams option. here's an example:
jQuery("#InvestorName").autocomplete('<%= Url.Action("Autocomplete", "DocMgmt") %>', {
dataType: 'json',
extraParams: { type: "InvestorName" },
max: 20,
width: 355,
matchContains: "word",
autoFill: false,
parse: function(data)
{
var rows = new Array();
for (var i = 0; i < data.length; i++)
rows[i] = { data: data[i], value: data[i].InvestorId, result: data[i].InvestorName };
return rows;
},
formatItem: function(row, i, max)
{
return i + "/" + max + " [" + row.InvestorName + "]" + " (id: " + row.InvestorId + ")";
},
formatMatch: function(row, i, max)
{
return row.InvestorName + " " + row.InvestorId
},
formatResult: function(row)
{
return row.InvestorName;
}
}).result(function(event, data, formatted)
{
jQuery('#InvestorId').val(formatted);
});