hi
refer below threads
I wrote below code to show count of number(line) from text box into label:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var value = '';
$('[Id*=txtnumber]').keypress(function (e) {
if (e.which == 13) {
var temp = $(this).val();
value = temp + "@" + value;
var count = value.split('@').length - 1;
$('[Id*=Lblcount]').html(count);
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<textarea name="Textbox" rows="2" cols="20" id="txtnumber" style="height: 150px;
width: 250px;">
</textarea>
<br />
Count of number:<span id="Lblcount"></span>
</div>
</form>
</body>
</html>
there is some problem see below example:
05698977
01335459
01635482
Count of number:3
but when I delete one of above number like below:
05698977
01335459
Count of number:3
again it will display:3 it should display: 2
I expect that when I delete one number from textbox it decrease Count of number
best regards
neda