textbox creation using textbox input
Hi guys.if i give semicolon as input means i have to create a textbox in jquey.I tried this code and it flows correctly but it didn't show me the result.pls help me out..
-
- $(document).ready(function (){
- $("#hellotxt").on('keyup', function (event){
- if (event.keyCode == 59)
- {
- var txt = $("#hellotxt").val();
- var valueArray = txt.split(';');
- var valueSortArray = valueArray.sort();
- for (var i = 0; i < valueSortArray.length - 1; i++) {
- alert("friends");
- addbox();
- }
- }
- });
- });
addbox code is here
-
- function addbox() {
- var table = $(this).closest('table');
- if (table.find('input:text').length >= 0) {
- table.append('<tr> <input type="text" id="current Name" value="" /></td> <td><input type="text" id="current Name" value="" /> </td></tr>');
- }
- }
My html code is
<asp:TextBox ID="hellotxt" runat="server" placeholder="hi;ji;ki;li;"></asp:TextBox>
<table border="0" cellspacing="2">
<tr>
<td align="right">datas</td>
<td>
<input type="button" id="add" value="Add" />
<input type="button" id="del" value="Del" />
</td>
</tr>
</table>
please help me