Jquery Auto Focus On Next Input Field

Jquery Auto Focus On Next Input Field

Jquery | Auto Focus On Next Input Field The jquery code for autofocus on the next text input field. $(".input-key").keyup(function() { if ($(this).val().length == $(this).attr("maxlength")) { $(this).next('.input-key').focus(); } }); Let's go through the above jquery…
Web Scraping with PHP

Web Scraping with PHP

PHP | Web Scraping Web scraping is used to get specific data from another website when there is no API available for it. There are many techniques for web scraping. You can read more about this…
ChartJS | How to draw Bar chart from server data using MySQL, Ajax and PHP

ChartJS | How to draw Bar chart from server data using MySQL, Ajax and PHP

Chart.JS | Draw Bar chart from server data using MySQL, Ajax and PHP This example shows that how to draw a bar chart with data from the database server.  FILE STRUCTURE At the end of…
ChartJS change graph type based on Dropdown selection

ChartJS change graph type based on Dropdown selection

Chart.js | Changing graph type based on dropdown selection We can’t directly update the chart type in Chart.js, to achieve the requirement we need to destroy the original chart and then redraw the new chart.…
How to show data values on top of each bar in chart.js

How to show data values on top of each bar in chart.js

Chart.js | show data values on top of each bar This is an example of displaying data value on top of each bar of Chart.js in the web page. Step 1: Create a basic html…
Add bar chart in web page

Add bar chart in web page

Chart.js | Add bar chart in webpage This is a simple example of using Chart.js to create a bar chart in the webpage.  Step 1: Create a basic html file called "chart.html"  <!DOCTYPE html> <html…

How to refresh a page with jquery?

Jquery | Location reload() Method | Refresh a page The Location.reload() method reloads the current URL. Syntax location.reload(forceGet) The Location.reload() method reloads the current URL. By default, the value of forceGet is false which reloads…

How to get html attribute's value in jquery?

Jquery | attr | Get html attribute's value You can get the value of an attribute for the first element in the set of matched elements using .attr() function. Return the value of an attribute:…

Clear the TINYMCE editor's content using jquery.

JQuery | TINYMCE | Clear TINYMCE editor  There is a method called setContent() in TINTMCE which you can use to reset/clear the TINTMCE editor. <script> // if one editor existing in your page. tinyMCE.activeEditor.setContent(''); </script>…
 Uncaught TypeError: e.indexOf is not a function in JQuery

Uncaught TypeError: e.indexOf is not a function in JQuery

JQuery | Uncaught TypeError: e.indexOf is not a function This error occur because you may try to load an event handler which is removed from latest version of jQuery. Event handler like .load(), .error(), .toggle()…

CodeIgniter where_in condition

Codeigniter | where_in  The where_in() allows you to pass an array in where clause. It generates a WHERE field IN ('item', 'item') SQL query. Syntax: $this->db->where('condition'); <?php $ids = array('1', '2', '3'); $this->db->from('users'); $this->db->where_in('id', $ids);…
A non-numeric value encountered in PHP

A non-numeric value encountered in PHP

PHP | Warning: A non-numeric value encountered This error occur when you are trying to do a mathematical operation on an integer with a nun-numeric value or a string.  Info: New E_WARNING and E_NOTICE errors…

Comments in PHP

PHP | Comments A comment in PHP code is a line that is not executed as a part of the program. It's only read by someone who is looking at the code. By reading the comments…

Is PHP a case sensitive language?

PHP | Case Sensitive In PHP, keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are not case sensitive but all variable names are case-sensitive.   If you defined function name in…

PHP Syntax and Tags

PHP | Syntax and Tags PHP introduce list of Tags to code php. PHP tags allow PHP parsing engine to get in and get out from the php block. A php script can be placed…

What will be the value of $x when given statement execute?

PHP | Statement $x = 3 + "15%" + "$25"? The correct answer is 18. Here’s why: PHP is a  losely typeed language, therefor it do automatic type conversion based on the context in which…

What are the errors in below code? What will be output and how can you fix it?

PHP | Array error fix | array_merge() The output will be as follows: array(2) { [0]=> int(1) [1]=> int(2) } NULL NULL It will also generate two warning messages as follows: Warning: array_merge(): Argument #2…

What will be the output of the following statements and why?

PHP | Output of the following statements var_dump(0123 == 123); var_dump('0123' == 123); var_dump('0123' === 123   var_dump(0123 == 123) This will output bool(false) because the leading 0 in 0123 tells PHP interpreter to treat the value…

What will be the output of $a and $b once code bellow is executed?

PHP | output of $a and $b once this code $a = '1'; $b = &$a; $b = "2$b" executed; Both $a and $b will output a string "21".   Because the statement $b = &$a; sets…