Sunday, October 10, 2010

Jquery Validation - DATE mm/dd/yyyy format

Experimenting with JQuery, I was asked to add certain validations for the form, DATE in mm/dd/yyyy format.

Well not very difficult, below is the code..

<-- Include JQuery -->

<script charset="utf-8" src="" type="text/javascript"></script>

<-- Include the Validation Plugin, NOTE - I have included from MS website instead of, it was down while working and throwing error in VALIDATOR method -->

<script type="text/javascript" src=""></script>

<-- Now add a Method to validate date in mm/dd/yyyy format with the regular expression -->

    $.validator.addMethod("DateFormat", function(value,element) {
        return value.match(/^(0[1-9]|1[012])[- //.](0[1-9]|[12][0-9]|3[01])[- //.](19|20)\d\d$/);
                "Please enter a date in the format mm/dd/yyyy"
        rules: {
            arrival: {
                required: true,
                DateFormat: true
            departure : {
                required: true,
                DateFormat: true

That's all what is required ..

Note you can include the validation plugin from as well, but as I wrote above it was down while writing this post.

Thursday, September 2, 2010

PHP - Saving included php file in a variable

I am a ColdFusion Developer, got some work to do on PHP, below is a very basic thing, but being CF programmer you are used to using <cfsavecontent> tag to save contents of entire file, how can this be done using php, well sounds to be very simple

$fileContent = ob_get_contents();


Thursday, May 6, 2010

Coldfusion 9 ORM – Configuring Existing Database

Working with Coldfusion 9 and was very exited to begin using it, first experiment to configure existing database

Step 1 – Enable ORM and Define your database


Component { = “dashboards”;

this.ormenabled = “true”;

this.datasource = “mycy”;


Step 2. Add your existing table properties, here I am considering table named “reportsdata”



* @persistent




property name=”reportdataid” fieldtype=”id” generator=”increment”;

property reportdataname;

property reportdatavalue;

property adddate;

property addby;

property moddate;

property modby;


That’s all, now we can test it out



reportData = EntityLoadByPK(“reportsdata”,40);



Wednesday, February 3, 2010

Check out Save Our Tigers | Join the Roar

Title: Save Our Tigers | Join the Roar

Saturday, January 16, 2010

KSRTC - Bangalore to Coorg Online Booking

I was looking for a bus booking from Bangalore to Coorg and was really happy to find lots of post which said you can book it at

The sign up process at was really fast, but their search feature sucks, and I was not able to find any bus service from Bangalore to Coorg, I also tried, Bangalore - Madikeri and Bangalore - Kodagu but NO results. Finally I tried Bangalore to Virajpet, as I know that Virajpet is very close to Coorg. That search gave me the name "MERCARA", which is COORG.

So if you are looking to book tickets to Coorg on KSRTC, then search for BANGALORE to MERCARA. You will find A/C busses operating to and fro. Another strange thing on KSRTC is that if you are booking a return ticket, then your return journey can only be 5 days ahead, otherwise you cannot book return ticket !

Notes - wikipedia page --