Posts Tagged ‘javascript’

How to select the first element of a dropdown using jQuery?

Written by rsolberg. Posted in All, Software Development

Let’s suppose that you are trying to identify what the first element or value us within a dropdown menu or specifically a select list. Suppose that your select list looks like this… If you wanted to figure out what the very first element of the drop down was, you could use this line of jQuery to get it. Suppose that you wanted to update all the selects or dropdown menus on your page to the first item in the list… You could do that by executing this line of jQuery.    

Data Localization With JavaScript

Written by rsolberg. Posted in Software Development, Technology

I worked on an ASP.NET app with localization and globalization. I was having some difficulty understanding how to get the Date() function in javascript to work properly given the user’s environment. My user base was split between Mexico (spanish) and the US (english). Since the Mexico date format is dd/mm/yyyy and the english format is mm/dd/yyyy, the standard Date(strDate) javascript constructor does not work for me. Then i found Datejs… What a savior! I started off by reading their blog post titled “Getting Started With Datejs“…. Hopefully you’ll find the tool as useful as I did.
© Copyright RSolberg, 2003 - 2014. All Rights Reserved