Saludos, tengo el siguiente código:
Código HTML:
<head>
<script>
function popupLogin() {
if (!formIsValid()) return;
var username = document.login.username.value;
var width = 800;
var height = 600;
var y = (screen.height - height) / 2;
var x = (screen.width - width) / 2;
var url = 'chat.php?username=' + username;
var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';
window.open( url, 'chat', options );
}
</script>
</head>
<body>
<table width="220" border="0" align="center" cellpadding="0" cellspacing="0">
<form action="chat.php" method="post" name="login" id="login">
<tr>
<td width="71" align="center" class="submenu">Nickname:</td>
<td width="149"><input type="text" class="campos" name="username" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="button" class="boton" type="button" onclick="javascript:popupLogin();" value="A Chatear" /></td>
</tr>
</form>
</table>
Todo esto esta dentro de un popup, lo que quiero hacer es que cuando de click en el boton "A Chatear" se abra otro popup en donde se mostrará el chat (de eso yo me encargo), pero quiero hacer que el popup que contenga este código se cierre luego de presionar el boton "A Chatear"
Muchas Gracias