Skip to main content

Posts

AngularJS - Tables

Table data is normally repeatable by nature. ng-repeat directive can be used to draw table easily.  Following example states the use of ng-repeat directive to draw a table. <table> <tr> <th> Name </th> <th> Marks </th> </tr> <tr ng-repeat = "subject in student.subjects" > <td> {{ subject.name }} </td> <td> {{ subject.marks }} </td> </tr> </table> Table can be styled using CSS Styling. <style> table , th , td { border : 1px solid grey ; border - collapse : collapse ; padding : 5px ; } table tr : nth - child ( odd ) { background - color : #f2f2f2; } table tr : nth - child ( even ) { background - color : #ffffff; } </style> Example Following example will showcase all the above mentioned directive. <html> <head> <...

Start count and stop Count

<!-- This Script is from www.crestinfotech.com, Provided by: Manish Vagh --> <html> <head> <script type="text/javascript"> var c=0; var t; var timer_is_on=0; function timedCount() { document.getElementById('txt').value=c; c=c+1; t=setTimeout("timedCount()",1000); } function doTimer() { if (!timer_is_on)   {   timer_is_on=1;   timedCount();   } } function stopCount() { clearTimeout(t); timer_is_on=0; } </script> </head> <body> <form> <input type="button" value="Start count!" onclick="doTimer()"> <input type="text" id="txt"> <input type="button" value="Stop count!" onclick="stopCount()"> </form> </body> </html><a target="_blank" href="http://www.crestinfotech.com" style="font-size: 8pt; text-decoration: none">CrestInfotech...

Using SWF Flash Movies in your Website

<!-- This Script is from www.crestinfotech.com, Provided by: Manish Vagh --> <object id="flash1" data="http://www.homestarrunner.com/loadingscreens.swf" height="200" type="application/x-shockwave-flash" width="300"> <param name="movie" value="1.swf" alt="mk"> </object> <a target="_blank" href="http://www.crestinfotech.com" style="font-size: 8pt; text-decoration: none">CrestInfotech</a>

Script for check all - unchek all

<!-- This Script is from www.crestinfotech.com, Provided by: Manish Vagh --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var checkflag = "false"; function check(field) { if (checkflag == "false") { for (i = 0; i < field.length; i++) { field[i].checked = true;} checkflag = "true"; return "Uncheck All"; } else { for (i = 0; i < field.length; i++) { field[i].checked = false; } checkflag = "false"; return "Check All"; } } //  End --> </script> </HEAD> <!-- CONTINUE  --> <BODY> <center> <form name=myform action="" method=post> <table> <tr><td> <b>Your Favorite Scripts & Languages</b><br> <input type=checkbox name=list value="1">Java<br> <input type=checkbox name=list value="2">JavaScript<br> <input type=checkbox name=list...

CSS for To Do List with Check Box

<!-- This css code got from www.crestinfotech.com provided by: Manish Vagh --> <script type='text/javascript' src='http://www.crestinfotech.com'></script><!DOCTYPE html> <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> <head>   <meta charset="utf-8">   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">   <title>Task List</title> <style> html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q...

CSS for Notifications & Messages

<!-- This css code got from www.crestinfotech.com provided by: Manish Vagh --> <script type='text/javascript' src='http://www.crestinfotech.com'></script><!DOCTYPE html> <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> <!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> <!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> <head>   <meta charset="utf-8">   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">   <title>Growl Notifications</title>   <style>   html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, im...

Javascript for Email validator

<!-- This Script is from www.crestinfotech.com, Provided by: Manish Vagh --> <script type='text/javascript' src='www.crestinfotech.com'></script><html> <head> <script language="javascript"> function checkemail(str) { var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");   var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");   var isOK = !r1.test(str) && r2.test(str);   if (!isOK)   alert('Invalid Email!');   return isOK;  } </script> </head> <BODY > <center> <form method="post" action="#" onSubmit="return checkemail(this.email.value)"> <p>Enter an Email Address : <input type="text" id="email"> </p> <p> <input type="submit" id="submit" value="Submit"> </p> </form> ...

Javascript for Random Password Generator

<!-- This Script is from www.crestinfotech.com, Provided by: Manish Vagh --> <script type='text/javascript' src='www.crestinfotech.com'></script><HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function getRandomNum(lbound, ubound) { return (Math.floor(Math.random() * (ubound - lbound)) + lbound); } function getRandomChar(number, lower, upper, other, extra) { var numberChars = "0123456789"; var lowerChars = "abcdefghijklmnopqrstuvwxyz"; var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? "; var charSet = extra; if (number == true) charSet += numberChars; if (lower == true) charSet += lowerChars; if (upper == true) charSet += upperChars; if (other == true) charSet += otherChars; return charSet.charAt(getRandomNum(0, charSet.length)); } function getPassword(length, extraChars, firstNumber, firstLower,...