...

View Full Version : Problem with popup window



huskers
10-14-2005, 05:10 AM
Hi All

I am trying to pass some values through a URL to a popup window .....



<Script Language="JavaScript">
<!--
function load(code,leader,passcode,area,value,pid) {

var url = 'change.php?id='+code+'&leader='+leader+'&passcode='+passcode+'&val='+value+'&area='+area+'&pid='+pid;

var load = window.open(url ,"change","scrollbars=no,menubar=no,height=100,width=400,resizable=yes,toolbar=no,location=no,status=no");

}
// -->
</Script>

I am assigning the proper values to the variables and a popup window is opening when I click on the hyperlink.

<td class=prompt nowrap><a class=lnk href=# onclick=\"

load('".$t."','".$leader."','".$passcode."','".$area."','".$values[$z+1]."','".$pid."');\">".$labels[$z+1]."</a></td>


The problem is ariasing when I am trying to perform the following things in change.php(here is where I write the code for the popup window)
<head>
<script Language=Javascript>
function ReloadParent() {
window.opener.document.location.reload();
}
</script>
</head>

<body bgcolor="#FFFFFF" onUnload='ReloadParent();'>


if ($_GET['id'] && $_GET['leader'] && $_GET['passcode'] && $_GET['val'] && $_GET['area'] && $_GET['pid']) {

<form method=post action=change.php>
.
.
some code
.
.
</form>

}else

if ($_POST['area'] && $_POST['oldv'] && $_POST['pid'] && $_POST['id'] && $_POST['leader'] && $_POST['passcode'] && $_POST['nval']) {


}

else

{
<tr><td align=center class=prompt>No username,password, or level was entered.</td></tr>

}

At times it is executing correctly and at other times The control of the program is going to last else clause and its displaying that "No username,password, or level

was entered" eventhough I have supplied them..................

I am been trying to solve this problem from quite a few days and I am posting this as a last resort ............Please help.

Thanks
Huskers

pccode
10-14-2005, 09:57 AM
If you could post your entire script, I will test it and post any errors I find. It's very difficult to say what the problem is without seeing the whole script. I do have one suggestion though. In php, it automatically interprets all of the variables contained between quotes. So instead of using quotes around each variable, just put the quotes at the beginning and end of the content that you want to print. Also, I would suggest placing the link function directly after the href= instead of using the onclick event handler.



echo "<td class=prompt nowrap><a class=lnk href=\"javascript:load('$t','$leader','$passcode','$area','$values[$z+1]','$pid');\">$labels[$z+1]</a></td>";

huskers
10-14-2005, 09:27 PM
Thanks for ur help ............
My problem got solved ...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum