I have page1.php that has the a link to a popup. I need to send a variable to the popup window.

I'm currently using this in the body:

<a href="#" onclick="actpopup(<?echo($act_id);?>)"><?echo($date);?></a>

This is the function actpopup

url = "serv_act.php?act_id=act_id";
options = "height=175, width=300, location=no, scrollbars=no,menubars=no,toolbars=no,resizable=yes,left=50";
window.open(url,name,options);

But for line "URL = "serv_act.php?act_id=act_id";, the last act_id i need to be the variable that is in the anchor in the body.

Thanks.

Hey,
ur actpopup funstion is unclear.
Here i have define function. hope it works.

<script language="javascript">
function actpopup(act_id)
{
	var url = "serv_act.php?act_id="+act_id;
	var opt = "height=175, width=300, location=no, scrollbars=no,menubars=no,toolbars=no,resizable=yes,left=50";
	var name = "popup";
	window.open(url,name,opt);
}
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.