Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm a complete newbie to mvc5 and am trying to write a simple mapping application. At the moment, the workflow works as follows:

i. user typle in a list of identifiers in textarea1
ii. user click on a button.
iii. the controller queries the database mapping table.
iv. the result is listed in textarea2.

I have this pretty much working but am wondering if i can remove the button click altogether and do the mapping "on the fly" ala google translate.

I've googled around but examples always seem to involve the user clicking on things like drop down lists etc... and am struggling with finding relevent articles.

Any help would be much appreciated. Thanks.
Posted

1 solution

You need to handle your blur event or your changed event ( if the latter, with a timer to time when someone has stopped typing ) and then fire your event. Pretty straightforward, if you must do that. I think having a button is fine. I'd just make it so that 'enter' pushes the button, instead of doing it on the fly.

You can use Chrome to view Google's code if you want to see how they do it. Right click and choose 'inspect element', although odds are, it has an id, and code elsewhere attaches events to it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900