What my code trying to do is to add new group if it is not yet created,well, that's work fine now however I also want to open a new popup window as soon as the group is created, prompting user to invite other, but I don't seems to get my work working, any idea on how to make it works?
thanks
<html>
<head>
<script type="text/javascript">
function addGroup()
{
x=document.getElementById("group").getElementsByTagName("p");
groups=document.getElementById("groupName");
var j=0,i=0;
if (groups.value=="")
{
alert('must create one group');
}
for (i=0;i<x.length;i++)
{
if (x[i].innerHTML == groups.value)
{
alert('the group name is already created');
return false;
}
}
if (!j)
{
var newNode=document.createElement('p');
var newString=document.createTextNode(groups.value);
newNode.appendChild(newString);
x[0].parentNode.appendChild(newNode);
newWindow();
}
}
function newWindow()
{
window.open('http://invite Others.html','invite
others','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes');
winObj.focus();
}
</script>
</head>
<body>
<div id="group">
<ul>
<p>Group03</p>
<p>Group02</p>
</ul>
</div>
<p><input type="text" id="groupName" size="84" maxlength="84" value=""/></p>
<p><input type="button" value="create" onclick="addGroup()" /></p>
<p><input type="button" value="remove" onclick="removeNo()"/> </p>
</body>
</html>