Not specifically ASP.MVC related, but I used JQuery because of it so I’m grouping it in anyway.
Created for a screen which needed to hide/show controls based on a radio button list selection, something which I’ve done before but the simplicity of how to implement it with JQuery impressed me so I’m blogging it.
It uses two bits of standard JQuery functionality, selecting elements based on class and applying css styles to the selection of elements.
- Decorate the elements to hide/show with css classes which will control when they are displayed, table rows in this example:
Simple! Doing it using plain JS would have been much longer and harder to maintain (changing the elements to display just requires modifying the classes).