Friday, June 27, 2008

Call Functions across parent and child windows using iframe

how to call child window(in iframe) function from parent window?
how to call parent window function from child window(in iframe)....

Simple.
From parent window.... framename.child_function_name()

From child window... parent.parent_function_name()


Demo

Download


Cheers!

Div over flash problem in HTML

Some may have this problem.
Always the flash object looks like placed in front of all the objects. So if we want to put a div in front of flash/ over flash we cant.

But there s a solution...
The normal flash object....
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="519" height="255">
<param name="movie" value="center_flash.swf">
<param name="quality" value="High">
<embed src="center_flash.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="519" height="255" quality="High">
</object>

To make it back of all elemnts add
<param name="wmode" value="transparent">


So the actual code we want is...
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="519" height="255">
<param name="movie" value="center_flash.swf">
<param name="quality" value="High">
<param name="wmode" value="transparent">
<embed src="center_flash.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="519" height="255" quality="High">
</object>

Demo

Download

Cheers!

Wednesday, June 18, 2008

Radio button validation in Javascript (HTML)

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Check Test</title>
<script language="javascript">
function valBox()
{
var x = document.chkForm;
var i, flg = 0;

for( i=0; i<x.grp.length; i++ )
{
if(x.grp[i].checked)
flg=1;
}
if(!flg)
{
alert("Select One");
return false;
}
}
</script>
</head>
<body>
<form name="chkForm" method="POST" action="#" onsubmit="return valBox();">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table1">
<tr>
<td><input type="radio" value="V1" name="grp">1</td>
</tr>
<tr>
<td><input type="radio" value="V2" name="grp">2</td>
</tr>
<tr>
<td><input type="radio" value="V3" name="grp">3</td>
</tr>
<tr>
<td><input type="submit" value="Submit" name="B1"></td>
</tr>
</table>
</div>
</form>
</body>
</html>