Using the push clause mechanism using JavaScript and jQuery (ASP.NET MVC project)

Yesterday, I discovered that jQuery is really powerful and can do amazing things with only a few (sometimes only one) lines of code, awesome! I made an animation that went very well!

So, I was wondering if the following is possible: implement jQuery (if not, tell me what can be done):

Basically, I want to use the suggestion mechanism for the web application I’m creating. We do this using ASP.NET MVC 4. By the mechanism of the sentence, I mean that the user receives a text field, he can begin to enter text and be based on his typing topics (I have a class of the Subject class with several properties). The user can ONLY choose from these topics; they themselves cannot determine them. Therefore, I would like to create a list based on input (with every keystroke). If they click on an item, it is added to the field, and they can select other topics if they wish.

I understand that this is probably quite difficult to implement, but it would be great if I could find a tutorial or an example. It is preferable to use JavaScript or jQuery, but if this is not possible, everything will be valid!

If my explanation is not clear enough: I mean something similar to the StackOverflow tag suggestion mechanism.

0
source share
1 answer

If you want a suggestive text field, look for the html5 datalist datalist Also look at the JqueryUI Auto Complete However, if the options are not too large, I would go with the selection menu instead of the text field.

+1
source

Source: https://habr.com/ru/post/1534900/


All Articles