My ASP.NET MVC 3 site generates and html with scripts around my input fields, to provide a cascading dropdown functionality.
For example, in my html I have a script call like this:
$ae.ajaxDropdown(
$ae is defined in a separate .js file. My problem is that I need some jQuery parent.change subscriptions not to work until a user has actually stareted interacting with the page and by doing this – invoked jquery routines on html elements.
If we could have used C# on the client, I would just use a bool isBeforeInteraction variable, that I would set to true at the beggining of the javascript parsing and execution, and would have set to false when the user has actually started elements manipulations. My jquery .change subscriptions would then work.
Is there a similar way to filter js code (that is in a separate .js file) based on a “page-wide” boolean variable?
You can handle the keydown event as follows: