Posts

Showing posts from February, 2016

Php Form validation with Error messages with Checking fields.

Here i coded form validation using only php with display error messages and checking input fields correctly entered or not Registration Form Name is Required Email Required Password Required Contact Details Required Gender:      Male       Female Gender is required Address required Please find the below code clearly with bootstrap and css also included. Add bootstrap folder into your project. <!DOCTYPE> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="\bootstrap\css\bootstrap.css"> <link rel="stylesheet" type="text/css" href="\bootstrap\css\bootstrap.min.css"> <script src ="..\bootstrap\js\bootstrap.js"></script> <script src ="..\bootstrap\js\bootstrap.min.js"></script> <title>Form Validation</title> <st

Dynamic table creation with given user input values using Javascript.

Create a dynamic table using given Rows and Columns using Javascript. Enter Rows:  Enter Cols:  <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript"> function createTable() {     var num_rows = document.getElementById('rows').value;     var num_cols = document.getElementById('cols').value;     var theader = '<table border="1">\n';     var tbody = '';     for( var i=0; i<num_rows;i++)     {         tbody += '<tr>';         for( var j=0; j<num_cols;j++)         {             tbody += '<td>';             tbody += 'Cell ' + i + ',' + j;             tbody += '</td>'         }         tbody += '</tr>\n';     }     var tfooter = '</table>';     document.getElementById('wrapper').innerHTML = theader + tb

Display the Day of given Date using Jquery.

 You entered Some date it will display the day of that date.   Example: 02-Feb-2016.                    Your Entered date is Tuesday. <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Untitled Document</title>   <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="style.css"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>

Difference Between two Dates using JQuery or Javascript?

Here code use difference between two dates. <!DOCTYPE html> <html> <head>   <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script></script> <link rel="stylesheet" type="text/css" href="style.css">  <script> $(document).ready(function(){     var $datepicker1 =  $( "#datepicker1" );     var $datepicker2 =  $( "#datepicker2" );     $datepicker1.datepicker();     $datepicker2.datepicker({          onClose: function() {             var fromDate = $datepicker1.datepicker('getDate');             var toDate = $datepicker2.datepicker('getDate');              

How to check give value is number or character or string in jQuery?

Check whether given value is number or character or string? <!DOCTYPE html> <html> <head>   <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="style.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>   <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>   <script type="text/javascript"> $(document).ready(function(){ $("#btn").click(function(){ var y = $("#number").val(); if(y>0 || y==0) { alert("You entered number"); } else if(y.length > 1) { alert("you entered string"); } else { alert("you enterd charcter"); } }); }); </script> </head&g

Write a program to Sum of Digits in JQuery?

Write a program to accept a no. from user and display Sum of Digits. (example: 214= 2+1+4 =  7) < !DOCTYPE html> <html> <head>   <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="style.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>   <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>    <script type="text/javascript"> $(document).ready(function(){ $("#btn").click(function(){ var x = 0; var y = parseInt($("#sum").val()); while(y>0) { x = x + y % 10; y = Math.floor(y/10); } alert("sum of digits " + x); }); }); </script> </head> <body> <div> <h2>Su

Write a Jquery program to check input alphabets vowel or not ?

Check you entered alphabet is Vowels  or  Consonants   ? <!DOCTYPE html> <html> <head>   <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" type="text/css" href="style.css">   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>   <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>   <script type="text/javascript"> $(document).ready(function(){ $("#btn").click(function(){ var ch = $("#split").val(); if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch =='o' || ch=='O' || ch == 'u' || ch == 'U') { $("#demo").html("You Enter alphab

From validation with messages using JQuery and Javascript?

Please find the below link to form validation using Jquery and Javascript. Download and use it. https://github.com/kirankumar-nyros/Generic-validation-Jquery

Write a JavaScript program to check whether the given year is leap year or not?

<html> <head> <title>Two textbox, when enter data in one textbox, it appears in second textbox</title> <link rel="stylesheet" type="text/css" href="style.css"> /<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script> <script type="text/javascript"> $(document).ready(function(){                $("#leap1").click(function(){ var yr = $("#leap").val(); if (yr%4 == 0) { if (yr%100 == 0) { if (yr%400 != 0) { alert("Not Leap year"); return "false"; } if (yr%400 == 0) { alert("Leap year"); return "true"; } } if (yr%100 != 0) { alert("Leap Year"); return "true"; } } i

Simple calculator using JQuery and HTML..

<html> <head> <title>Two textbox, when enter data in one textbox, it appears in second textbox</title> <link rel="stylesheet" type="text/css" href="style.css"> /<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ //Addition $("#add").click(function(){ var a = $("#cal1").val();   var b = $("#cal2").val(); $("#result").val(+a + +b); }); //Subtraction $("#sub").click(function(){ var a = $("#cal1").val();    var b = $("#cal2").val(); $("#result").val(+a - +b); }); //Multiplication $("#mul").click(function(){ var a = $("#cal1").val();   v