Posts

Showing posts from October, 2015

Jquery: replace character of select drop down values with other

below code snippet can be used to replace "-"  of select drop down values with ",". JQuery('#sel_test option:contains ("-")).each function(index,option)    {       var sval = JQuery(option).val().replace(/\-/g,",");       JQuery(option).val(sval);       JQuery(option).html(sval);     }

Jquery: how to validate time format HH:MM

There are many ways to validate HH:MM format. Below function also can be used to validate HH:MM format. function ValidateTime(value) {   var timepattern = /^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;   if (value.match(timepattern ))     {        return true;     }  return false; }