...

View Full Version : Help making popout window with this html form..



javanoobie9
02-28-2008, 03:20 AM
I got this 5 star rating script online and I'm trying to make a window popup instead of going to addrating.php on the same page. Can't seem to do it. I've added the onsubmit javascript, but still can't do it.



<SCRIPT TYPE="text/javascript">
function openWindow(url){
window.open(url,'','width=640,height=480,top=100,left=100');
}
</SCRIPT>

<form name="rate" method="post" action="<?php echo($hm2); ?>/addrating.php" onSubmit="openWindow('addrating.php');">
<b>This Page has been currently rated as: </b>
<?php for($i=1;$i<=5;$i++)
{
if($rateval>=1)
{
echo "<img src=\"$hm2/images/star2.gif\">";
$rateval=$rateval-1;
}
else if($rateval>=0.5)
{
echo "<img src=\"$hm2/images/star3.gif\">";
$rateval=$rateval-1;
}
else if ($rateval<0.5 && $rateval>0)
{
echo "<img src=\"$hm2/images/star1.gif\">";
$rateval=$rateval-1;
}
else if($rateval<=0)
{
echo "<img src=\"$hm2/images/star1.gif\">";
}
}
?>
</td>
</tr>
<style>
.star{cursor:pointer; }

</style>
<Script language=javascript>
function selstar(val)
{
for(var x=1;x<=val;x++)
{
document['i'+x].src="<?php echo "$hm2";?>/images/star2.gif";
}

}
function remstar(val)
{
for(var x=1;x<=val;x++)
{
document['i'+x].src="<?php echo "$hm2";?>/images/star1.gif";
}
}

function setrate(val)
{
document.rate.rating.value=val;
document.rate.submit();
}
</script>

<tr>
<td align=center>
<b>Rate this Page :</b>
<img name=i1 class=star onmouseover="selstar(1)" onmouseout="remstar(1)" onclick="setrate(1)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i2 class=star onmouseover="selstar(2)" onmouseout="remstar(2)" onclick="setrate(2)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i3 class=star onmouseover="selstar(3)" onmouseout="remstar(3)" onclick="setrate(3)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i4 class=star onmouseover="selstar(4)" onmouseout="remstar(4)" onclick="setrate(4)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i5 class=star onmouseover="selstar(5)" onmouseout="remstar(5)" onclick="setrate(5)" src="<?php echo "$hm2";?>/images/star1.gif">
<input type="hidden" name="rating">
<input type="hidden" value="<?php echo "$url"; ?>" name="url">
<input type="hidden" value="<?php echo "$rip"; ?>" name="ip">
<input type="hidden" value="<?php echo "$id"; ?>" name="templateid">

</form>

gnomeontherun
02-28-2008, 03:44 AM
<form name="rate" method="post" action="<?php echo($hm2); ?>/addrating.php" target="_blank">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum