Tuesday, March 29, 2011

Java script to get list box text

When you want to get list box selected text from your application using java script use the following js code.

var w = document.getElementById('picklistid').selectedIndex;
var selected_text = document.getElementById('picklistid').options[w].text;

selected_text variable will be returned the combo box selected text.

Wednesday, March 9, 2011

Mysql Date

Some useful SQL commands to get dates in Mysql server.

select curdate() 3/10/2011
select curdate()-1 20110309
select curdate() - INTERVAL 1 DAY 3/9/2011