Posts

Showing posts from October, 2017

phone no validation

< form > Phone Number (format: xxx-xxx-xxxx): < input type = "tel" pattern = "^\d {3} -\d {3} -\d {4} $" required > < input type = "submit" value = "Submit" > </ form > < form > Phone Number (format: xxxxxxxxxx): < input type = "tel" pattern = "^\d {10} $" required > < input type = "submit" value = "Submit" > </ form >

Javascript onkeyup

<html>     <head>         <script>             function add()             {                 var a = parseInt(document.getElementById("t1").value);                 var b = parseInt(document.getElementById("t2").value);                 var result = a + b;                 document.getElementById("s1").innerHTML = result;             }         </script>         <title>Addition Using Aja...

Display records from database using pie chart

<?php $con=mysqli_connect('localhost','root','root','pie_chart') or die(mysqli_connect_error());    $query=mysqli_query($con,"select * from visitors") or die(mysqli_error($con));  ?> <html>   <head>     <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>     <script type="text/javascript">       google.charts.load('current', {'packages':['corechart']});       google.charts.setOnLoadCallback(drawChart);       function drawChart() {         var data = google.visualization.arrayToDataTable([           ['country', 'Visits'],           <?php           while ($row=mysqli_fetch_assoc($query)) {  ...