- 2010
-
2009
- December
- November
- October
- September
-
August
-
Slide Show more then one image in Java Script
08/25/09
<html>
<title>:: Image Rotation ::</title>
<a href="" id="link1"><img src="" name="Rotating1" id="Rotating1" height="100" width="100"></a>
<a href=&quo -
Change something in multiple files using Find
08/22/09
find ./ -name 'index.cgi' -exec sed -i 's#$shortboardname = "";#$shortboardname = "";\n$meta_title= "ESL/TEFL Jobs";#' '{}' \; -
Copy a folder from one folder to multiple folders
08/21/09
perl -e 'opendir DR,".";@files = grep {/tesl/} readdir DR;foreach (@files) {next if ! -d $_; print $_,"\n";$x=qq{cp -rf ~/public_html/esl-tesol-jobs/captcha/ $_/};print $x,"\n";qx{$x};} closedir DR;' -
Change Images Slidshow in Java Script
08/21/09
<html>
<head>
<script type="text/javascript">
var slideimages=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages=new Image()
slideimages.src=slideshowimages.arguments
-
Show the Tip box in html using Javascript
08/20/09
<script type = "text/javascript">
var TipBoxID = "TipBox";
var tip_box_id;
function findPosX(obj)
{
var curleft = 0;
if(obj.offsetParent)
while(1)
{
curleft += obj.offsetLeft;
-
TextBox Counter in Javascript
08/20/09
Just copy and paste this code and view textbox counter.
<script language = "Javascript">
/**
* DHTML textbox character counter script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
maxL=255;
var bName = navigator.appName;
-
Check All CheckBox on click in Javascript
08/20/09
<script language = "Javascript">
var form='frmSample' //Give the form name here
function SetChecked(val,chkName) {
dml=document.forms[form];
len = dml.elements.length;
var i=0;
for( i=0 ; i<len ; i++) {
if -
Date validation in Java Scripts
08/20/09
<script language = "Javascript">
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
var i;
for (i = 0; i < s.length; i+ -
Count the words in a sentence using PHP
08/19/09
<?php
$str = "I am the best";
echo str_word_count($str);
?>
********out put *******
4 -
Calculate the similarty between two string
08/19/09
<?
$string1="rakesh";
$string2="rake";
$string3="rakesh";
$string4="rakesh";
similar_text($string1, $string2, $p);
similar_text($string3, $string4, $q);
echo "Percent: $p%".'<br>' -
Pad a string to a certain length with another string
08/19/09
<?php
$input = "Rakesh";
echo str_pad($input, 10, "*", STR_PAD_LEFT); //pad in left side
echo str_pad($input, 10, "#", STR_PAD_BOTH); //pad in both side
echo str_pad($input, 10 , "@"); //pad in right side -
Replace the string instead of searching string in PHP [Replace String ]
08/19/09
<?php
$replace = str_replace("r", "t", "kumar");
echo $replace;
?>
**********output ********
kumat
// here r replace with t -
Repeat the String
08/19/09
<?php
echo str_repeat("S2k", 10);
?>
// here s2k repeat 10 times.
******* output ******
S2kS2kS2kS2kS2kS2kS2kS2kS2kS2k -
Convert special characters to HTML entities
08/19/09
<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new;
?>
********out put **********
// <a href='test'>Test</a> -
Join the all Array elemments in a single string in PHP
08/19/09
<?php
$array = array('S2k', 'Design', 'Delhi');
$join_array = join(",", $array);
print "<pre>";
print_r ($array);
print "</pre>";
echo $join_array;
?>
-
change first letter of String in upper case in php
08/19/09
<?php
$first = 'my name is rakesh';
$first = ucfirst($first); // Hello world!
echo $first;
?>
***********out put********
My Name is Rakesh -
Change All charachter of string in Uppercase and Lowercase in PHP
08/19/09
<?php
$str = "India is the best";
$str = strtoupper($str);
echo $str;
echo '<br>';
$str1 = "INDIA IS THE BEST";
$str1 = strtolower($str1);
echo $str1;
?>
**********
//output
INDI -
Convert the HTML entities to their Decoded format
08/19/09
<?php
$myhtml="I m "the" <b>best</b> ";
$mydecode= html_entity_decode($myhtml);// out put comes like
echo $myhtml.'<br';
?>
**************Out Put ******
I m "the&q -
Remove Space from right of the given text in PHP
08/19/09
There are two function to remove space from right of the text:
(1) chop(string,"");
(2) rtrim(String,"");
//chop("yourstring ","");
<?php
$before='First ';
echo $before.'Second -
CheckBox validation in HTML using Javascript
08/19/09
<SCRIPT TYPE="text/javascript" LANGUAGE=JAVASCRIPT>
function validcheck() {
if (document.frmTest.chk1.checked == false &&
document.frmTest.chk2.checked == false &&
document.frmTest.chk3.checked == false)
{
-
Validate Email id with Regular Expression in Javascript
08/19/09
<script>
function Validation(){
var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
str = document.getElementById('txtemail').value;
if(str.match(emailRegEx)) {
alert(str+' is valid emai -
Radio Button validation using Javascript in HTML
08/18/09
This is very simple way to validate radio button through Javascript in HTML Form.
<script type="text/javascript">
function validate_form (str) {
valid = true;
if (
(document.frmSample.rdo1[0].checked == false )
&am -
Validate TextBox that accept only Numeric value using javascript.
08/18/09
This code display a textbox that accept only numeric value.
<script type="text/javascript">
function Validation(){
var a=document.getElementById('MyTextBox').value;
var regex1=/^[0-9]*$/;
if(regex1.test(a)== false){
-
validate TextBox that accept only Alphabatic value using Javascript
08/18/09
<script type="text/javascript">
function Validation(){
var a=document.getElementById('MyTextBox').value;
var regex1=/^[a-zA-Z][a-zA-Z]*$/;
if(regex1.test(a)== false){
alert('Please enter only Alphabatic ');
MyTextBo -
Validate TextBox that accpet only Alphanumeric value without white Space
08/18/09
TextBox that accept only Alphanumeric value without any white space.
<script type="text/javascript">
function Validation(){
var a=document.getElementById('MyTextBox').value;
var regex1=/^[a-zA-Z][a-zA-Z0-9]*$/;
if(regex1.test(a)== false){ -
Validate TextBox that accpet only Alphanumeric value with white Space
08/18/09
This is a simple way to validate a textbox that accept only alphanumric value with space.
<script type="text/javascript">
function Validation(){
var a=document.getElementById('MyTextBox').value;
var regex1=/^[a-zA-Z][a-zA-Z0-9 ]*$/; //thi -
Convert the moved items as a PHP array and display that in ListBox using Java Script
08/18/09
Here two page one is select.php and another is view.php, in view.php we diplay the array elements from moved items in second ListBox from page Select.php.
// Select.php //
****************
<script type="text/javascript">
function goto(path) {
wind -
Display items HTML ListBox from PHP array list.
08/18/09
To retrive itmes from a PHP array to a ListBox and display that.
<?php
$items = array('country' => array(1 => 'India',
2 => 'Pakistan',
3 => 'England',
4 =>'Japan',
-
Java Script To Move Selected Items from one <Select> to another [ Multiple / Single ]
08/18/09
To View a good example, Just copy and paste this code in html format and run it.
<script type="text/javascript">
function goto(path) {
window.location.href = path;
}
function fnMoveItems(lstbxFrom,lstbxTo)
{
var varFromBox = do -
Dispaly value in Div from Listbox OnChange Event [ Value ]
08/18/09
To view the example just copy and paste this code in your html page.
<script language="javascript">
function ListBox1_DoubleClick() {
document.getElementById('ListBox1Hidden').innerHTML = document.frm1.select1.value;
} -
HTML Page Structure
08/10/09
For making HTML pages always create the following folders:
img
css
js
img = All Images should go in img folder.
css = All css files should go in css folder.
js = All Javascript should go to js folder.
There SHOULD NOT BE any CSS or JavaScript Code -
JavaScript Code to go to a page
08/10/09
Javascript code to go to page
Path = URL to goto
function goto(path) {
window.location.href = path;
}
to call:
<script type='text/Javascript'>goto('screen2.php');</script> -
TextBox Validation
08/10/09
This function performs Textbox Validation using Javascript
function validate_form1()
{
valid = true;
if ( document.frm.username.value == "" ) {
alert( "User Name Should Not be Empty." )
-
Slide Show more then one image in Java Script
- 2008

Calendar



