Category archive

HTML

Post related to HTML

17 articles

HTML

Jquery Date time picker – Show only required dates enabled

<html> <head> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js”></script> <script type=”text/javascript” src=”https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.full.min.js”></script> <link rel=”stylesheet” type=”text/css” href=”https://cdnjs.cloudfla

Jun 20, 2024

Read article

General

Add Prefix in text field

When you have to prefix any hard coded value in a text field, like for example in telephone field you have to prefix the country code and dont want the user to remove it, then in that case assign the prefix code in the text field and add the below javascript code code jQuery(“input[name=’job-code’]”).keydown(function(e

Jan 27, 2024

Read article

General

Detect Change in form fields

<script type=”text/javascript”> var formChanged = false; jQuery(window).load(function() { // This is triggered when the entiire page is loaded fully // form id and all the possible filed type in that form, You can also target by field type, name, class or id jQuery(‘#FrmIdToTarget input[type=text], #FrmIdToTarget selec

Jan 26, 2024

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

HTML

Validate date format mm/dd/yyyy in jquery or javascript

<script type=”text/javascript”> function isValideDate(datavalue){ var regexValidDate = /^(?:(0[1-9]|1[012])[\/.](0[1-9]|[12][0-9]|3[01])[\/.](19|20)[0-9]{2})$/; return regexValidDate.test(datavalue); } var dateToCheck = ’06/01/2011′, if(isValideDate(dateToCheck)){ alert(“Given date is valid as per the format of MM/dd/Y

Mar 8, 2018

Read article

HTML

Redirect to another page after a specific time interval

<html> <body> <h1>Welcome to my Website</h1> <h4 id=”msg”>You will be redirected to another page in 5 seconds!</h4> <script type=”text/javascript”> function countDown(i, callback) { callback = callback || function(){}; var int = setInterval(function() { //document.getElementById(“displayDiv”).innerHTML = “Number: ” + i

Jan 23, 2018

Read article

CMS

How to wrap data column in Gridview widget in yii or yii2 framework

The column which you want to wrap should be added the property called “contentOptions” where you can apply the css property to suits your needs and requirements as below. [ ‘attribute’ => ‘column name’, ‘format’ => ‘html’, ‘noWrap’ => false, ‘mergeHeader’=>true, ‘contentOptions’ => [‘style’ => ‘width: 50%; overflow: sc

Nov 20, 2017

Read article

HTML

validate mobile number on keypress using jquery

How to validate and restrict unwanted character for mobile or phone number field using jquery $(document).ready(function () { $(‘#mobile’).keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^0-9]/g, function (str) { return ”; })); }); });

Aug 8, 2015

Read article