asp.net-mvc ajax query on keypress rather than submit button -


I am using Ajax.BeginForm to update the data on a webpage (as per the code below). Anyway, I can stop backend server pressing every key instead of waiting to kill the submit button

In this way, when I type "a", then this query on "a" And will show all the DB results, so if I type "B" then it will filter the list of "now" and so forth ...

Current code using the submit button < / Strong>

  & lt;% (Ajax.BeginForm ("GetPeople", "Contact", New AjaxOptions {UpdateTargetId = "Contact", Loading ElementId = "updating", OnSucces S = "done"})} {%> gt; & lt; fieldet style = "text-align: left:"> legend & gt; contact search & lt; / legend> gt; & gt; & lt; Tr & gt; & lt; td & gt; 1st Name: & lt; / td & gt; & lt; td & gt; & lt; Input style = "width: 300px" type = "text" name = "firstpost" /> Gt; & lt; / td & gt; & lt; / tr & gt; & lt; tr & gt; & lt; TD & gt; Last Name: & lt; / td & gt; & lt; td & Gt; & lt; Input style = "width: 300px" type = "text" name = "last palette" /> gt; & lt; / td & gt; & lt; / tr & gt; & Lt; Tr & gt; & Lt; Td> & Lt; Input type = "submit" value = "search" name = "submit" gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; / T enabled & gt; & Lt; / Fieldset & gt; & Lt;%}% & gt;  

I was suggesting to see jQuery plugin It does what you are asking for and only you need to have an action that answers the questions and returns the mail set based on the query parameter, it is highly configurable and well Tested. In your case, you have to take advantage of the ability to add parameters to use many search criteria like first and last names. For example, use the last name as the last autocomplete completion and send any letters in the first name field as additional values ​​for the query.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -