Category archive

web development

General Posting

82 articles

javascript

Jquery set input value and trigger on blur event

I want to trigger an event every time i click on select on any element by id First i will try to set the input value by the following code pickedvalue = jQuery(‘#someElementId’).val(); jQuery(‘#anotherInputElement’).val(parseInt(pickedvalue)); // use parseInt if the input type is “number” else not required. After setti

Sep 10, 2020

Read article

PHP

How to show or hide yii2 gridview action button conditionally

In Yii2 Gridview normally to display the action button we have the following chunk of code $columns = [ [‘class’ => ‘yii\grid\SerialColumn’], ‘name’, ‘description:ntext’, ‘status’, [ ‘class’ => ‘yii\grid\ActionColumn’, ] ]; The output you see as below: Now you have a scenario, to show the edit button only when the “Zon

Jun 4, 2020

Read article

linux

export mysql database – mysql dump

When you have access to the command line and you have the export large database, you will not be able to export from phpmyadmin. Hence mysql provide you handy method to export the database from the command line. Below are various options, you can use while exporting the database. ——databases – This allows you to [&hell

Apr 14, 2020

Read article

linux

How to change the php version for the console

Many a times when you view the php version in the browser by displaying the phpinfo() information and the php version that is displayed when you see by typing the command “php -v” in the console or command prompt, You will notice that there is difference in the two. So how to set the php […]

Nov 18, 2019

Read article

ajax

Ajax call using jquery

function makeAjaxRequest(data1,data2,…..,datax){ $.ajax({ ‘type’:’POST’, async: false, url: ‘http://www.example.com/some_request_url’, data:{param1:data1,param2:data2,….,paramx:datax}, success : function(response) { console.log(response); // Using this you can check the posted data in browser console window return true

Sep 18, 2019

Read article

CMS

Yii2 how to set custom value for checkbox in gridview widget

In Yii2, while you use gridview widget to display your table data, for performing any operation on the record by selecting the checkbox, gridview assign the value of the first column retrieved from your the result set. But you need to set some different value to the checkbox, so to do that you can use […]

Aug 4, 2019

Read article

javascript

issue with submit form in ajax success response

Usually when we try to submit the form after ajax call on success response, the form does not’t get submitted. Like for example in below code:- $.ajax({ type : “POST”, url : “to/some/url”, data : { userName:userName, mobileNumber:mobileNumber, otp:otp }, dataType : “json”, success : function(data) { if(data.result == t

Jul 12, 2019

Read article

Drupal

Drupal 8 render block from node twig file

{{ drupal_entity(‘block’, ‘put your block id here’, check_access=false) }} check_access=false => This is to make check if the block is allowed to access by which kind of user; default is false, which allow the block to be displayed without any check.

Feb 23, 2019

Read article