Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have one .aspxpage contains 19 rows.Every row contain 7 textboxes one dropdown button i want to show one row only in that page by clicking + button it will automatically added to page..So can any one help me i am new web pages so can pls help indetail coding...

What I have tried:

i have no idea about this topic i write the code for 19 textboxes i want to reduce the code.
Posted
Updated 28-May-17 21:17pm

1 solution

ASP.NET
<head runat="server">
    <title></title>
    <script>

        function addRow()
        {
            var tableRef = document.getElementById('myTable').getElementsByTagName('tbody')[0];

            // Insert a row in the table at the last row
            var newRow = tableRef.insertRow(tableRef.rows.length);

            // Insert a cell in the row at index 0
            var newCell = newRow.insertCell(0);

            var input = document.createElement('input');
            input.type = "text";
            // Append a text node to the cell
           
            newCell.appendChild(input);

            return false;
            
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <button onclick="return addRow();">click me</button>
        <table id="myTable" border="1">
            <tr><td>Hello1</td></tr>
            <tr><td>Hello2</td></tr>
        </table>
    </div>
    </form>
</body>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900