very useful ajax effects to ur site

17 Dec 2008 phpcodes

one window web development code for windows download

13 Dec 2008 phpcodes

validations

13 Dec 2008 phpcodes

ajax effects

11 Dec 2008 phpcodes

enable/disable with radio button

9 Dec 2008 phpcodes
by selecting radio button enabling the another radio buttons,like the same same fashion
 we can modify this as we like

————————————————————————————————————-
<head>
<SCRIPT LANGUAGE=”JavaScript”>

function Disab (val) {
if(val==”1″)
{form1.gr11[0].disabled=false;
form1.gr11[1].disabled=false;
form1.gr12[0].disabled=true;form1.gr12[0].checked=false;
form1.gr12[1].disabled=true;form1.gr12[1].checked=false}
if(val==”2″)
{form1.gr11[0].disabled=true;form1.gr11[0].checked=false;
form1.gr11[1].disabled=true;form1.gr11[1].checked=false;
form1.gr12[0].disabled=false;
form1.gr12[1].disabled=false}
}
</SCRIPT>
</head>
<body>
<form name=”form1″ method=”post” action=”">
<input type=”radio” name=”gr1″ value=”Yes” onClick=”Disab
(1)”>
<input type=”radio” name=”gr11″ value=”Yes” disabled>
<input type=”radio” name=”gr11″ value=”No” disabled>
<BR><BR>
<input type=”radio” name=”gr1″ value=”No” onClick=”Disab
(2)”>
<input type=”radio” name=”gr12″ value=”Yes” disabled>
<input type=”radio” name=”gr12″ value=”No” disabled>
</form>
</body>

———————————————————————————————————-

show hide effect with radio button

9 Dec 2008 phpcodes
show hide effect with radio button
show hide effect using radio button
———————————————————————————————————–
<script type=text/javascript>
<!–
var txt = “Please list the date and location of the event below.\n\n”;
txt += “<tr><td colspan=”2″>Event Date:\n\n”;
txt += “<input name=”eventdate” type=”text” id=”eventdate” size=”15″ maxlength=”150″ class=”form” onFocus=”this.className=’focused’” onBlur=”this.className=’blured’” />\n\n”;
txt += “Event Location: <span class=”alternate”><font size=”3″>\n\n”;
txt += “<input name=”eventlocation” type=”text” id=”eventlocation” class=”form” onfocus=”this.className=’focused’” onblur=”this.className=’blured’” />\n\n”;
txt += “</font></span></td></tr>”;

function showT(r){
    if(r.checked){
        document.getElementById(’RadioText’).innerHTML=txt;
        document.getElementById(’RadioText’).style.display=”block”;
    }
    else{
        document.getElementById(’RadioText’).innerHTML=”"; // optional
        document.getElementById(’RadioText’).style.display=”none”;
    }
}
//–>
</script>
<input name=”m_support” type=”radio” value=”Help with the test account” onclick=”showT(this);” />
<span id=”RadioText”></span>

————————————————————————————–
here is one more check it out
——————————————————————————————————-
<html>
<head>
<title>Help me</title>

<style type=”text/css”>
.hide {display: none}
</style>

<script type=”text/javascript”>
function hideDivArea(str_area_hide){
tag = document.getElementsByTagName(“div”);
for(x=0;x<tag.length; x++)
{
if(tag[x].getAttribute(’id’).indexOf(str_area_hide) != -1)
{
tag[x].style.display = “none”;
}
}
}
function showDivArea(areas_show, areas_hide){

for (var i = 0; i < areas_show.length; i++)
{
ge = document.getElementById(areas_show[i]);
ge.style.display = “block”;
}
for (var i = 0; i < areas_hide.length; i++)
{
hideDivArea(areas_hide[i]);
}
}
</script>

</head>
<body>
<table>
<form name=”form1″ id=”form1″ method=”post” action=”">
<tr>
<td width=”200″><input type=”radio” name=”name1″ value=”a1″ onclick=”javascript:showDivArea(['area51', 'area54'], ['area52'])”>Area 51!!</td>
<td width=”200″><input type=”radio” name=”name2″ value=”a2″ onclick=”javascript:showDivArea(['area52'], ['area51'])”>Ooh its gone</td>
</tr>
<tr>
<td><div class=”hide” id=”area51″>ID content “a1″ (area51)</div></td>
<td><div class=”hide” id=”area52″>ID content “a2″ (area52)</div></td>
<td><div class=”hide” id=”area53″>ID content “a3″ (area53)</div></td>
<td><div class=”hide” id=”area54″>ID content “a3″ (area54)</div></td>
</tr>
<tr>
<td colspan=”3″>&nbsp;</td>
</tr>
</form>
</table>
</body>
</html>

———————————————————————————————————-

checkbox show/hide

9 Dec 2008 phpcodes
check box show/hide effect
———————————————————————————————————-
<html>
<title>Test</title>

<head>
<script type=”text/javascript”>
function toggle(divToShow) {
if (document.getElementById) {
if (divToShow.checked == true) {
document.getElementById(’withdiv’).style.display = “inline”;
} else {
document.getElementById(’withdiv’).style.display = “none”;
}
}
}

</script>
</head>

<body >

<input type=”checkbox” name=”sam” value=”1″ id=”with”
onclick=”toggle(this)” /> With
<div id=”withdiv” style=”display:none;”>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”20%”><select name=”">
<option>– Select –</option>
</select>
</tr>
<tr>
</td>
<td><textarea name=”" cols=”" rows=”"></textarea>
</td>
</tr>
</table>
</div>
</body>
</html>

———————————————————————————————————-

check show/hide effecft with dropdown

9 Dec 2008 phpcodes
show/hide effect with dropdown value
———————————————————————————————————–

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”Content-type” content=”text/html; charset=utf-8″ />
<title>Show/Hide</title>
<script type=”text/javascript”>
// <![CDATA[
function display(obj,id1,id2) {
txt = obj.options[obj.selectedIndex].value;
document.getElementById(id1).style.display = ‘none’;
document.getElementById(id2).style.display = ‘none’;
if ( txt.match(id1) ) {
document.getElementById(id1).style.display = ‘block’;
}
if ( txt.match(id2) ) {
document.getElementById(id2).style.display = ‘block’;
}
}
// ]]>
</script>
</head>

<body>
<table width=”340″ cellspacing=”0″ cellpadding=”2″>
<thead>
<tr>
<td class=”title”>Type:</td>
<td class=”field”>
<select name=”type” onchange=”display(this,’text’,'image’);”>
<option>Please select:</option>
<option value=”image”>Image</option>
<option value=”text”>Texts</option>
<option value=”invisible”>Invisible</option>
</select>
</td>
</tr>
</thead>
<tfoot>
<tr>
<td class=”align-center” colspan=”2″><input type=”submit” name=”submit” value=”Update” /> <input type=”reset” value=”Reset” /></td>
</tr>
</tfoot>
<tbody id=”text” style=”display: none;”>
<tr>
<td class=”title”>Text Color:</td>
<td class=”field”><input type=”text” name=”color” size=”8″ maxlength=”7″ /></td>
</tr>
</tbody>
<tbody id=”image” style=”display: none;”>
<tr>
<td class=”title”>Image:</td>
<td class=”field”><input type=”file” name=”image” size=”10″ /></td>
</tr>
<tr>
<td class=”title”>X Coordinates:</td>
<td class=”field”><input type=”text” name=”x_coordinates” size=”5″ /></td>
</tr>
<tr>
<td class=”title”>Y Coordinates:</td>
<td class=”field”><input type=”text” name=”y_coordinates” size=”5″ /></td>
</tr>
<tr>
<td class=”title”>Text Color:</td>
<td class=”field”><input type=”text” name=”color” size=”8″ maxlength=”7″ /></td>
</tr>
</tbody>
<tbody>
<tr>
<td class=”title”>Display:</td>
<td class=”field”>
<select name=”display”>
<option value=”visitors”>Visitors</option>
<option value=”hits”>Hits</option>
</select>
</td>
</tr>
</tbody>
</table>
</body>
</html>
———————————————————————————————————-

show/hide by selecting dropdown value

9 Dec 2008 phpcodes
by selecting the dropdown value showing the content
Check the following code it’s working perfectly
————————————————————————————————————-
        <html>
<head>
<title>Show and Hide</title>

<script>
//*********************************************
// Function that Shows an HTML element
//*********************************************
function showDiv(divID)
{
var div = document.getElementById(divID);
div.style.display = “”; //display div
}

//*********************************************
// Function that Hides an HTML element
//*********************************************
function hideDiv(divID)
{
var div = document.getElementById(divID);
div.style.display = “none”; // hide
}
//*****************************************************************************
// Function that Hides all the Div elements in the select menu Value
//*****************************************************************************
function hideAllDivs()
{
//Loop through the seclect menu values and hide all
var selectMenu = document.getElementById(“selectMenu”);
for (var i=0; i<=selectMenu.options.length -1; i++)
{
hideDiv(selectMenu.options[i].value);
}
}
//*********************************************
// Main function that calls others to toggle divs
//*********************************************
function toggle(showID)
{
hideAllDivs(); // Hide all
showDiv(showID); // Show the one we asked for

}

</script>
</head>
<body onload=”hideAllDivs();”>

<select id=”selectMenu” onchange=”toggle(this.options[this.options.selectedIndex].value)”>
<option value=”formNumber1″> Show Form 1 </option>
<option value=”formNumber2″> Show Form 2 </option>
<option value=”formNumber3″> Show Form 3 </option>
<option value=”formNumber4″> Show Form 4 </option>

</select>

<div id=”formNumber1″> I am Form Number one. Any content within this div will be showed</div>

<div id=”formNumber2″> I am Form Number two. Any content within this div will be showed</div>

<div id=”formNumber3″> I am Form Number three. Any content within this div will be showed</div>

<div id=”formNumber4″> I am Form Number four. Any content within this div will be showed</div>

</body>
</html>
——————————————————————————————————————————

checkbox show/hide effect

8 Dec 2008 phpcodes
check the follwing code for show/hide by clicking the checkbox,to show another checkbox
and vice… versa
————————————————————————————————————-
<script type=”text/javascript”>
function showHide(id){
   el = document.getElementById(id);
   el.style.display = (el.style.display != ‘block’)? ‘block’ : ‘none’;
}
</script>
<form name=”form1″ id=”form1″ method=”post” action=”">
  <input type=”checkbox” name=”chk1″ value=”checkbox” onclick=”showHide(’chk2′)” />
  <input style=”display:none” type=”checkbox” name=”chk2″ id=”chk2″ value=”checkbox” />
</form>
————————————————————————————————————-