Fijate así:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
<script>
function agregar(param){
document.getElementById('listnick').value = document.getElementById('listnick').value + document.getElementById(param).value + "\n";
}
function quitar(linea){
var par=new RegExp(linea+'[\r\n]+');
var txt=document.getElementById('listnick').value.split(par);
if(!par.test(document.getElementById('listnick').value)){
alert('No existe ese nick');
document.getElementById('nick').focus();
return;
}
if(document.getElementById('nick').value==""){
alert('Debe escribir el Nick a Borrar');
document.getElementById('nick').focus();
return;
}else if(confirm("¿Esta seguro de borrar el nick?")){
document.getElementById('listnick').value=txt.join ('');
document.getElementById('nick').value="";
}
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<textarea name="listnick" rows="5" id="listnick"></textarea>
<input name="algo" type="text" id="algo" />
<input type="button" name="Submit" value="agregar" onclick="agregar('algo')" />
texto:
<input name="lin" type="text" id="nick" />
<input type="button" name="Submit2" value="quitar" onclick="quitar(nick.value)" />
</form>
</body>
</html>