How To Uncheck A Checkbox In Jquery

how to uncheck a checkbox in jquery $(“#myCheckBox”).prop(“checked”, false); Source: www.tutorialrepublic.com jquery set checkbox checked unchecked //jQuery 1.6+ use $(‘.checkbox’).prop(‘checked’, true); //false for uncheck //jQuery 1.5.x and below use $(‘.checkbox’).attr(‘checked’, true); //false for uncheck jquery uncheck checkbox $(‘#myCheckbox’).prop(‘checked’, true); // Checks it $(‘#myCheckbox’).prop(‘checked’, false); // Unchecks it get unchecked checkbox jquery if ($(“#check_box_id”).is(‘:checked’)) { alert(“checked”); }else{ … Read more

“Laravel Migration Change To Make A Column Nullable

Laravel Migration Change to Make a Column Nullable composer require doctrine/dbal Source: stackoverflow.com laravel migration make column nullable Schema::table(‘users’, function($table) { $table->string(‘name’, 50)->nullable()->change(); }); This is the correct syntax to revert the migration: $table->integer(‘user_id’)->unsigned()->nullable(false)->change(); Source: stackoverflow.com laravel migration table column nullable $table->string(/*column name*/, /*size*/)->nullable(true);  

Changing Columns For Table “Users” Requires Doctrine DBAL. Please Install The Doctrine/Dbal Package

Changing columns for table “users” requires Doctrine DBAL. Please install the doctrine/dbal package. composer require doctrine/dbal Source: stackoverflow.com Changing columns for table “” requires Doctrine DBAL. Solution: $ composer remove doctrine/dbal $ composer require doctrine/dbal:2.* I hope it helps someone, good luck 😉  

Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ Not Found

Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ not found composer require doctrine/dbal Source: stackoverflow.com Class ‘Doctrine\DBAL\Driver\PDOPgSql\Driver’ not found # For Laravel 6x/7x: composer require doctrine/dbal:”^2.0″ # For Laravel >= 8x: composer require doctrine/dbal Source: stackoverflow.com Symfony\Component\Debug\Exception\FatalThrowableError : Class ‘Doctrine\DBAL\Driver\PDOSqlite\Driver’ not found Symfony\Component\Debug\Exception\FatalThrowableError : Class ‘Doctrine\DBAL\Driver\PDOSqlite\Driver’ not found  

Chart Js Remove Grid

chart js remove grid var options = { scales: { xAxes: [{ gridLines: { display:false } }], yAxes: [{ gridLines: { display:false } }] } } Source: stackoverflow.com chart js remove grid options: { scales: { xAxes: [{ gridLines: { drawOnChartArea: false } }] } }  

Consider Using ‘–ResolveJsonModule

Consider using ‘–resolveJsonModule add “resolveJsonModule”: true key in tsconfig.json { “compilerOptions”: { “target”: “es2015”, “module”: “commonjs”, “strict”: true, “moduleResolution”: “node”, “resolveJsonModule”: true } } Cannot find module ‘./data.json’. Consider using ‘–resolveJsonModule’ to import module with ‘.json’ extension add to tsconfig.json { … “resolveJsonModule”: true } } Source: mariusschulz.com –resolveJsonModule declare module “*.json” { const value: any; … Read more

Js Random Hex Color

js random hex color ‘#’+Math.floor(Math.random()*16777215).toString(16); Source: www.paulirish.com javascript random color generator function generateRandomColor() { var letters = ‘0123456789ABCDEF’; var color = ‘#’; for (var i = 0; i < 6; i++) { color += letters[Math.floor(Math.random() * 16)]; } return color; } var randomColor=generateRandomColor();//”#F10531″ function to generate random color in javascript function random(number){ return Math.floor(Math.random()*number);; } function … Read more

Days Array

days array fullName [“Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”]; shortName [“Mon”, “Tue”, “Wed”, “Thu”, “Fri”, “Sat”, “Sun”]; days array javascript [ “Sunday”,”Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”];  

Jquery Set Attribute Readonly

jquery set attribute readonly // jQuery < 1.9 $(‘#id’).attr(‘readonly’, true); // jQuery >= 1.9 $(‘#id’).prop(‘readonly’, true); add readonly attribute jquery $(input).attr(‘readonly’, true); add readonly attribute jquery $(‘#inputId’).attr(‘readonly’, true); Source: nullorempty.org  

Javascript Regex Email

javascript regex email function validateEmail (emailAdress) { let regexEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; if (emailAdress.match(regexEmail)) { return true; } else { return false; } } let emailAdress = “test@gmail.com”; console.log(validateEmail(emailAdress)); regex validate email function validateEmail(email) { const re = /^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); js email regex function isValidEmail(email) { const re = /^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); how to validate … Read more

Alpine Js Cdn

alpine js cdn <script src=”https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.2/dist/alpine.min.js” defer></script> alpinejs cdn <script defer src=”https://unpkg.com/alpinejs@3.4.2/dist/cdn.min.js”></script> Source: alpinejs.dev alpine js cdn <html> <head> …   <script defer src=”https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js”></script> </head> … </html> Source: alpinejs.dev alpine js <div x-data=”{ open: false }”> <button @click=”open = true”>Open Dropdown</button> <ul x-show=”open” @click.away=”open = false” > Dropdown Body </ul> </div> Source: github.com  

Window Load Jquery

window load jquery $(window).on(‘load’, function() { console.log(‘All assets are loaded’) }) Source: stackoverflow.com call a function on load jquery $(document).ready(function () { // Function code here. }); Source: stackoverflow.com  

Jquery Disable Input

jquery disable input //jQuery 1.6+ use: $(“#inputID”).prop(‘disabled’, true); //disable $(“#inputID”).prop(‘disabled’, false); //enable //jQuery 1.5 and below use: $(“#inputID”).attr(‘disabled’,’disabled’); //disable $(“#inputID”).removeAttr(‘disabled’); //enable disable input field with jquery // Disable #x $( “#x” ).prop( “disabled”, true ); // Enable #x $( “#x” ).prop( “disabled”, false ); jquery check input is disable if($(‘textbox’).is(‘:disabled’)){ //textbox is disabled } Source: stackoverflow.com … Read more

Prop Disabled

prop disabled //jQuery 1.6+ use: $(“#inputID”).prop(‘disabled’, true); //disable $(“#inputID”).prop(‘disabled’, false); //enable //jQuery 1.5 and below use: $(“#inputID”).attr(‘disabled’,’disabled’); //disable $(“#inputID”).removeAttr(‘disabled’); //enable disable input field with jquery // Disable #x $( “#x” ).prop( “disabled”, true ); // Enable #x $( “#x” ).prop( “disabled”, false ); enable input jquery $(‘input’).prop(‘disabled’, false); Source: stackoverflow.com  

JQuery Disable And Enable Input

jQuery disable and enable input //jQuery 1.6+ use: $(“#inputID”).prop(‘disabled’, true); //disable $(“#inputID”).prop(‘disabled’, false); //enable //jQuery 1.5 and below use: $(“#inputID”).attr(‘disabled’,’disabled’); //disable $(“#inputID”).removeAttr(‘disabled’); //enable

Javascript Sleep For 1 Second

javascript sleep for 1 second function delay(time) { return new Promise(resolve => setTimeout(resolve, time)); } delay(1000).then(() => console.log(‘ran after 1 second1 passed’)); Source: masteringjs.io js sleep 1 second await new Promise(resolve => setTimeout(resolve, milliseconds)) Source: www.codegrepper.com javascript sleep 1 second async function test() { console.log(‘start timer’); await new Promise(resolve => setTimeout(resolve, 1000)); console.log(‘after 1 second’); } test(); … Read more

Js 1 Second Delay

js 1 second delay function delay(time) { return new Promise(resolve => setTimeout(resolve, time)); } delay(1000).then(() => console.log(‘ran after 1 second1 passed’)); Source: masteringjs.io javascript wait 1 second setTimeout(function(){ console.log(“Ready”) }, 1000); javascript wait 1 second setTimeout(() => {console.log(‘1 second finished!’)}, 1000);