Archive

- for June, 2007

Client-side Table Sorting Using Javascript

What about the idea of giving the user power of sorting the table's column using JavaScript. User can sort any column of the table. I saw this facility from a software I was using. It was running very fast and smoothly. That web app was using JavaScript from another site.… (Continue)

Select all from textarea/ text input on onclick event

Here when an user click on a text link "select all", all the contents of the textarea will be highlighted. You can use onclick event directly on textarea also. <script type="text/javascript"> function select_all(element1) { // first set focus document.frm1.elements[element1].focus(); // select all contents document.frm1.elements[element1].select(); } </script> <form name="frm1"> <a href="#"… (Continue)

Javascript show hide div, p, input or any HTML elements

We provide hide unhide of an element for providing interactivity to user interface and sometime for providing input guidelines to user. Sometimes it is also used for saving space of web page. You will use this toggle view facility using your choice. You can have select list. There you can… (Continue)

Check and Remove Duplicate Values from PHP Array

I want to check whether my array holds duplicate entry and if it holds duplicate values then remove those duplicate value. This code will directly remove the duplicate value from an Array. 1. Remove duplicate values from an array <?php $arrUnique = array_unique ($array1); ?> This array_unique function work in… (Continue)

PHP array – Common Usage

You will use "print_r" and "foreach" many times during programming at the time of using array. <?php $arr3 = array('a', 'b', 'c', 'd'); echo '<pre>'; print_r($arr2); echo '</pre>'; ?> print_r() will print whole array with key=>value pair in human readable format. Delete every item, but not array foreach ($arr3 as… (Continue)

Array in PHP

Array Syntax: array ([key=>] value,) Key may be an integer or string, and value may be any value. <?php $arr1 = array ('lang'=>'php', 1=>true, 13); echo $arr1['lang'] ; // print php echo $arr1[1]; // 1 echo $arr1[2]; // 13 ?> As you can see above string 'key' is quoted. An… (Continue)