Feeds:
Posts
Comments

Archive for June, 2008

Let us consider we get a value from a post actionone,two,three
i.e: $ss = $_POST['arv'];
Now using the php method explode() we will convert the string in to a array object
explode(seperator,string);
i.e. $tok = explode(‘,’,$ss);
so we have got a string array. Now we print the array using print_r() method. This method prints the array in string [...]

Read Full Post »

The javascript array values can be passed to a php file using the following method
Step 1:
Let us consider we have a js array as
<script language=javascript>
scriptAr = new Array();
scriptAr[0] = “one”;
scriptAr[1] = “two”;
scriptAr[2] = “three”;
<script>

scriptAr = new Array();
scriptAr[0] = “one”;
scriptAr[1] = “two”;
scriptAr[2] = “three”;
Step 2:
Now we will create a hidden form field as follows
<form action=”phpArrayTest.php” [...]

Read Full Post »

This exemple below show how to display an XML file as an HTML table using XMLHttpRequest Object:
<html>
<head>
<script type=”text/javascript”>
var xmlhttp;
function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
{// code for IE7, Firefox, Mozilla, etc.
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{// code for IE5, IE6
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
}
if (xmlhttp!=null)
{
xmlhttp.onreadystatechange=onResponse;
xmlhttp.open(“GET”,url,true);
xmlhttp.send(null);
}
else
{
alert(“Your browser does not support XMLHTTP.”);
}
}
function onResponse()
{
if(xmlhttp.readyState!=4) return;
if(xmlhttp.status!=200)
{
alert(“Problem retrieving XML data”);
return;
}
txt=”<table border=’1′>”;
x=xmlhttp.responseXML.documentElement.getElementsByTagName(“CD”);
for (i=0;i<x.length;i++)
{
txt=txt + “<tr>”;
xx=x[i].getElementsByTagName(“TITLE”);
{
try
{
txt=txt + “<td>” + xx[0].firstChild.nodeValue + [...]

Read Full Post »

Most browsers have a build-in XML parser to read and manipulate XML. The parser converts XML into a JavaScript accessible object.
this the code below, enjoy :
<html>
<head>
<script type=”text/javascript”>
function parseXML()
{
try //Internet Explorer
{
xmlDoc=new ActiveXObject(“Microsoft.XMLDOM”);
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument(“”,””,null);
}
catch(e)
{
alert(e.message);
return;
}
}
xmlDoc.async=false;
xmlDoc.load(“note.xml”);
document.getElementById(“to”).innerHTML=xmlDoc.getElementsByTagName(“to”)[0].childNodes[0].nodeValue;
document.getElementById(“from”).innerHTML=xmlDoc.getElementsByTagName(“from”)[0].childNodes[0].nodeValue;
document.getElementById(“message”).innerHTML=xmlDoc.getElementsByTagName(“body”)[0].childNodes[0].nodeValue;
}
</script>
</head>
<body onload=”parseXML()”>
<h1>W3Schools Internal Note</h1>
<p><b>To:</b> <span id=”to”></span><br />
<b>From:</b> <span id=”from”></span><br />
<b>Message:</b> <span id=”message”></span>
</p>
</body>
</html>
source:http://www.w3schools.com

Read Full Post »

Placing Radio Button in the row items of Data grid which allows only one of the radio buttons to be selected at a time in Web applications is a well known problem.
The JavaScript code below will allow accomplishing the intended task of single select of radio button inside a data grid.
<script language=”javascript”>
function SelectOne(rdo,gridName)
{
/* Getting [...]

Read Full Post »

This some link to free javascript code source, for table, datagrid, Xml, and other’s..
hope this helpe to get started :
1- Ajax layer : Here
2- GUI Components: Here
3- Pages Components: Here
4- Security: Here

5- HTML: Here
6- Form control: Here

Read Full Post »