<?php 
$x=$_POST[T1];
....
....
....
?>

<head>
<script type="text/javascript">
function submitform()
{
  document.comm.submit();
}
</script>
</head>

<form method="POST" action="" name="comm">
<p><input type="text" name="T1" size="20"> <a href="javascript: submitform()">
Submit</a></p>
</form>

What i need is on clicking the submit link, the current popup or page should be closed.
But it must not close before the form data is posted.I mean....The data is posted on the form itself and after executing the php code on the top, the popup or page should close. Any suggestions or help will be greately appreciated.

try:

function submitform()
{
document.comm.submit();
setTimeout(function(){self.close();}, 50);
}
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.