Guest User

Untitled

a guest
Jan 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <div id="search" role="search">
  2. @using (Html.BeginForm("AdvancedSearch", "Search", FormMethod.Get, new { id = "SearchForm" }))
  3. {
  4. <input id="searchText" name="searchText" placeholder="Search the database…" type="text" autocomplete="on" />
  5. <div id="search-results" style="display:none">
  6. @*This is where I am having trouble getting the value for search Text*@
  7. @Html.Action("AutocompleteSuggestions", "Search", new { searchText = SearchForm.find('input[name="textboxList"]').val());}
  8. <hr />
  9. <a id="results-all" onclick='javascript:getAdvancedSearchUrl();'>
  10. SEE ALL RESULTS
  11. </a>
  12. <script type="text/javascript">
  13. function getAdvancedSearchUrl() {
  14. var searchTextValue = document.getElementById('searchText').value;
  15. var url = '@Url.Action("AdvancedSearch", "Search")?searchText=' + searchTextValue;
  16. $.post(url);
  17. }
  18. </script>
  19. </div>
  20. <input type="hidden" value="Search" />
  21. }
  22.  
  23. <div style="clear:both"></div>
  24. </div>
Add Comment
Please, Sign In to add comment