Set RadioButton value using jQuery

Setting RadioButton using jQuery should be simple. But, there is a small trivia about it. Consider a simple radiobutton group called Options which has values of Yes and No.

If you want to set the initial value of Option to No, how would you do it? You would probably use the val function as below:

But, the above[…]

Read more

Move items from one listbox to another using jQuery – Part 2

I have posted an earlier post on moving items from one ListBox to another. There were few comments that wanted enhancements on the post. Especially, a lot of readers wanted to know how this can be handled on the server side. So, I have come up with a second version of the post. Here is the code:

I have added[…]

Read more

Displaying your position in Bing maps

Using HTML5, it is possible to find the coordinates of your location. The coordinates can be used to display a Bing map with your position pinned to it. The post explains how to do this. Create a new ASP.NET MVC application. Using HTML5, the latitude and longitude of the current position can be found as follows.

Using Bing Maps,[…]

Read more

Learn HTML5 in 5 minutes

HTML5 is an evolving web standard. It has good adoption across browsers – IE (10), Firefox, Chrome, Safari, Opera. To see the level of compliance in your browser, visit http://html5test.com. In this post, I will quickly illustrate the basic features of HTML5. HTML5 introduces new semantic tags like article, section etc which help define the HTML document more logically. An[…]

Read more

Introduction to Knockout.js and ASP.NET MVC

Knockout.js is a javascript framework for creating MVVM like browser apps. MVVM stands for Model-View-ViewModel. Model represents the data. View represents the UI. ViewModel represents how the model is represented within the View. ViewModel also encapsulates the behaviour of the view. For eg, the rule: for some conditions in the data (model), set a green background to the table cell,[…]

Read more

Move items from one listbox to another using jQuery

I have two listboxes – list1, list2. There are four buttons. Add button to move selected items from one listbox to another. AddAll button to move all items from one listbox to another. Remove and RemoveAll buttons do the reverse operation. The code below shows how this can be done using jQuery. HTML

Javascript

The selector for selecting[…]

Read more

Updating textbox with checked items using jQuery

I have a CheckBoxList. When the user checks or unchecks the items in the CheckBoxList, a TextBox should be updated with the checked values separated by a comma. How can I do this? You can open up the designer. Add a CheckBoxList and TextBox as shown below:

After adding the HTML, you can add a simple script using jQuery.[…]

Read more

Popup Calendar Control

I want a simple Calendar control. The Calendar control should function like a FileUpload control. It should have a textbox and a button. On click on a button, the calendar control should open. On selecting a date in the calendar control, the popup window should close, and the textbox should be filled with the date. I want this Popup Calendar[…]

Read more