JustAskVin Insights

Ideas for leading and building technology well.

Practical writing on delivery, architecture, CMS migrations, digital growth, and the decisions that shape strong web experiences.

Latest

Page 7 of recent writing

All insights home →

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

CMS

How to search in specific content type in drupal 7

Suppose you have created a content type named as “testimonial”. Now the requirement is to for search for a value “hello” under field name “title” then you can do so by using the below query. Please make sure that you have the “Entity API” module enabled. $searchkeyword = $_REQUEST[‘keyword’]; $query = new EntityField

Aug 1, 2018

Read article

General

validate email id using jquery or javascript

function validateEmail(email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/; return emailReg.test(email); } Usage:- if(validateEmail(emailString)){ alert(‘Your email is valid’); } else{ alert(‘Your email is not valid! There should be atleast @ and one dot(.) present in it’); }

May 4, 2018

Read article