JavaScript: Toggling RadioButton Choices

Using JavaScript to dynamically change selections. In this example I will illustrate how to dynamically hide/show radiobutton choices based on the user selection. I’ll begin with a few simple asp.net radiobuttonlist controls. As you can see, the HTML generated by the asp.net control is quite extensive and potentially confusing. Therefore, I need a statement which…

JavaScript: Scroll User

Use JavaScript to dynamically move the user’s position on a web page. Due to business requirements within a page, sometimes users might be confused based on the activity they experience. For example, if a page allows the user to perform an action which affects the page, but below where their “focus” currently resides, they might…

JavaScript: Get RadioButtonList Selection

Using JavaScript to determine selections. First, I’ll begin with a simple asp.net radiobuttonlist control. Though the asp.net control is itself simple to deploy and use with C#, the html that’s rendered is anything but simple. You may overcome the difficulty of determining which radiobutton in the list is selected by utilizing the HTML input attribute…

JavaScript: Functions

Incorporating OOP into JavaScript for reusable logic. Though many programmers focus their OOP skills in C# while designing logic interfaces and classes, it’s just as important to do so when creating presentation-layer logic so that the code may be easily reusable. Below are examples of functions in JavaScript. This illustrates two objects being created using…

JavaScript: Classes

Incorporating OOP into JavaScript for reusable logic. Though many programmers focus their OOP skills in C# while designing logic interfaces and classes, it’s just as important to do so when creating presentation-layer logic so that the code may be easily reusable. Below are examples of classes in JavaScript followed by live examples. Human Class Instantiated…

JavaScript: Changing a CSS class

Using JavaScript to dynamically change a control’s CSS class. Using the DOM, JavaScript provides developers the options of dynamically modifying properties of HTML controls residing within the page. In this example, I will illustrate how to access a series of image buttons to change their CSS class in order to reflect the currently selected button.…