Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to trigger an auto suggest in others selection
    text
    copied!<p>I have two <code>autosuggest</code> using jquery which triggers on enter key . Code is follows</p> <pre><code>$("#Patient").autocomplete({ search: function (event, ui) { var key = CheckBrowser(event); if (key == 13) return true; else return false; }, source: function (request, response) { $.ajax({ url: '@Url.Action("PatientAutoSuggestByName")', data: { autoSuggestText: request.term }, // dataType: 'json', type: 'POST', success: function (data) { response(data); } }); }, select: function (event, ui) { if (SessionExist()) { $('#Patient_ID').val(ui.item ? ui.item.id : 0); $('#AsterID').val(ui.item ? ui.item.code : 'Select'); $("#VisitNo").focus(); $('#VisitNo').trigger("keypress", [13]); // here i want to trigger the second auto suggest } } }); </code></pre> <p>the second auto suggest is</p> <pre><code>$("#VisitNo").autocomplete({ search: function (event, ui) { var key = CheckBrowser(event); if (key == 13) return true; else return false; }, source: function (request, response) { $.ajax({ url: '@Url.Action("VisitorAutoSuggest")', data: { patientID: $('#Patient_ID').val(), autoSuggestText: $('#VisitNo').val() }, // dataType: 'json', type: 'POST', success: function (data) { response(data); } }); }, select: function (event, ui) { if (SessionExist()) { $('#Visit_ID').val(ui.item ? ui.item.id : 0); $('#VisitDate').val(ui.item ? ui.item.code : 'Select'); reloadGrid(); GetSettings(); $("#Remarks").focus(); } } }); </code></pre> <p>I want to <code>trigger the second auto suggest on the selection of first</code>. I tried <code>$('#VisitNo').trigger("keypress", [13]);</code> B'coz the auto suggest is triggerd in enter key. But this is not working. If anybody knows the solution please share</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload