This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arr_payment_ref_no = [1,2,3,3,4,33]; | |
var arr_payment_ref_no_unique = arr_payment_ref_no.filter(function(item, i, arr_payment_ref_no) { | |
return i == arr_payment_ref_no.indexOf(item); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).on("keydown", function (event) { | |
if (event.keyCode === 8 && !jQuery(event.target).is("input, textarea")) { | |
event.preventDefault(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//... | |
{ input: '#date_of_birth', message: 'invalid!', action: 'keyup,blur,change', rule: function(input,commit){ | |
if(input.val()==''){return true} | |
else | |
{ | |
var mydate = new Date(); | |
var year = mydate.getFullYear(); | |
year -= 18; | |
var month = parseInt(mydate.getMonth())+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.onreadystatechange = function(){ | |
if(document.readyState === 'complete'){ | |
............................ | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var date_regex = /^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/ ; | |
if(!(date_regex.test(inputed_date)) | |
{ | |
return false; | |
}else{ | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('#form_field_1,#form_field_2,#form_field_3').keypress(function(event){ | |
var keycode = (event.keyCode ? event.keyCode : event.which); | |
if(keycode == '13'){ | |
//your necessary code here | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).keypress(function(e) { | |
if(e.which == 13) { | |
// Your necessary code here | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mobile_no(val){ | |
if((/^(017|018|016|015|011|019)\d{8}/).test(val)) {return true} else {return false} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fsize = jQuery(selector)[0].files[0].size; | |
var ftype = jQuery(selector)[0].files[0].type; | |
// alert(fsize+" "+ftype); | |
if(fsize>(1048576*3) || ftype != 'application/pdf') //do something if file size more than 1 mb (1048576) | |
{ | |
return false; | |
}else | |
{ | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//to get the parent td index. Such as 4th number column | |
cellIndex = jQuery("#searchFiled").parent().index(); | |
//To get the heading from first row 4th number column | |
column_name = jQuery("#childtable"+i+" tbody tr:first").find('td:eq('+cellIndex+')').text(); | |
//select table object | |
var object = document.getElementById("facilityRow"); |
OlderNewer