jquery

Hide Element after div is loaded dynamically

There is a normal procedure in javascript to hide any element based on page load or click event. For eg, when the page is loaded and DOM is built, using the below code snippet, a button is able to hide the element after it is clicked.

$.function($) {
  $("#button").click(function() {
    $('#div').hide();
  });
}

Similarly, an element can be hidden based on some condition when the page is loaded. Eg - consider the below snippet -

Set default value for datepicker using jQuery in Drupal

Datepicker in drupal is rendered as separate select elements for day, month and year by default which makes it difficult to set a default value if we want to set it to some string value, eg. today, +2 months, etc. This page is to check how we can set default value for datepicker using a simple jQuery.

Get string from PHP

Consider you have the above string value. If you are sending this value from a php code, convert it to a date format using strtotime().

Datatable Search Filter

Datatable is a jQuery plugin which provides a great interface when it comes to display a table with quite a large number of rows. It helps in paging, sorting and several functionalities with only installing a simple plugin in our application. This page is to know how searching for a string can be done using datatable search filter.

Consider the datatable below -