Skip to content

Instantly share code, notes, and snippets.

View shohag-cse-knu's full-sized avatar

Syfur Rahaman Shohag shohag-cse-knu

View GitHub Profile
@shohag-cse-knu
shohag-cse-knu / Visual Studio 2022 Product Key
Created February 14, 2024 03:10 — forked from pablotolentino/Visual Studio 2022 Product Key
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
@shohag-cse-knu
shohag-cse-knu / gist:bc1fb2131e1f7ba8a3f37dc020a1649e
Created September 10, 2018 12:04
jQuery table row traversing without first row and last row
jQuery('#showFacilityBox .showTr:not(:first-child)').each(function(){ //:not(:last-child)
if(!jQuery(this).is(":last-child")){
if(this.cells[5].innerHTML == inner_outer)
{
var amount_bdt = (this.cells[6].innerHTML).replace(/,/g, "");
if(amount_bdt.charAt(0)=='(')
{
amount_bdt = amount_bdt.slice(0, -1);
amount_bdt = amount_bdt.substr(1);
}
<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");
@shohag-cse-knu
shohag-cse-knu / gist:d4c794efb45c60d835c4a692720d82da
Created September 10, 2018 11:59
jQuery PDF file validation
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;
}
@shohag-cse-knu
shohag-cse-knu / gist:e3efed644de70ef678104c851773b888
Created September 10, 2018 11:58
jQuery mobile number validation
function mobile_no(val){
if((/^(017|018|016|015|011|019)\d{8}/).test(val)) {return true} else {return false}
}
@shohag-cse-knu
shohag-cse-knu / gist:88ec5ae0f44d4365c9725b5ed28843d6
Created September 10, 2018 11:37
Event call when enter key is pressed over the page
jQuery(document).keypress(function(e) {
if(e.which == 13) {
// Your necessary code here
}
});
@shohag-cse-knu
shohag-cse-knu / gist:ef2c873810dd59c74d1936a1ef456491
Created September 10, 2018 11:34
Form submission when enter key is pressed in any form fields
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
}
});
@shohag-cse-knu
shohag-cse-knu / gist:14a8be7db3f7cefea8e782c46dd31d6b
Created September 10, 2018 11:31
jQuery Regex date validation
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;
}
@shohag-cse-knu
shohag-cse-knu / gist:30506f6ebaf6b0ef03741a558a01b8cb
Last active September 10, 2018 11:28
jQuery auto calling a function after page load complete
<script>
document.onreadystatechange = function(){
if(document.readyState === 'complete'){
............................
}
}
</script>
@shohag-cse-knu
shohag-cse-knu / gist:e7602f240528410e80916bda4cbfd1e3
Created September 10, 2018 11:25
Jqxvalidator birth date validation
<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