i has a problem with textarea find duplicate.
<textarea name="listnumber" >
12345678
12345674
12345678
12345672
12345678
</textarea>
and i auto remove duplicate when change using jquery. result will be like this
<textarea name="listnumber" >
12345678
12345674
12345672
</textarea>
Question : how to remove duplicated entries in the text area. as expected result shown above
EDIT
i got an textarea with name="listnumber"
My Source Code:
<script type="text/javascript">
<!--
$(document).ready(function() {
$("textarea#listnumber").bind('input propertychange keyup cut paste',function(){
text = $("textarea#listnumber").val()
lines = $.unique(text.split(/\r|\r\n|\n/))
count = lines.length
$('input#totalnumber').val(count)
});
});
-->
</script>
<form action="index.php" method="post">
<ul>
<li><label>List Of Number</label><textarea name="listnumber" id="listnumber" ></textarea></li>
<li><label>Total Number</label><input type="text" name="totalnumber" readonly="readonly" /></li>
</ul>
<a onclick="submit();" href="#" >Send List</a>
</form>
and i want jquery to remove the duplicate inside the textarea with using $('textarea').change(function(){} but i dont know how to do this. any one please help.