У меня короткое время и постараюсь быть кратким, если есть проблема с моим объяснением, я попытаюсь отредактировать по ночам.Добавить новую строку в таблицу HTML, когда заполнен предыдущий/текущий
Просто у меня есть стол, имя и возраст, он начинается, когда страница загружается одной строкой. Когда первый заполняется чем-то ненулевым, автоматически другая строка загружается пустым.
Я предпочитаю использовать JavaScript, но я также мог бы управлять с asp.net. Надеюсь, я хорошо себя объяснил и жалею, что так краток.
Любая помощь будет оценена по достоинству.
Edit: Код
<table class="table table-striped" style="margin:10px" id="tablaSKU" runat="server">
<thead>
<tr>
<th></th>
<th>SKU</th>
<th>Precio €</th>
<th>Descripción</th>
<th>Fecha Inicio Demo</th>
<th>Fecha Fin Demo</th>
<th>Tipo de préstamo</th>
</tr>
</thead>
<tbody>
<tr>
<th>1-</th>
<th class="col-sm-2" name="sku"><asp:TextBox ID="sku" runat="server" class="form-control"></asp:TextBox></th>
<th class="col-sm-1"><asp:TextBox ID="precio" runat="server" class="form-control"></asp:TextBox></th>
<th class="col-sm-3"><asp:TextBox ID="descripProd" runat="server" class="form-control"></asp:TextBox></th>
<th class="col-sm-2"><asp:TextBox ID="dataInit" runat="server" class="form-control"></asp:TextBox></th>
<th class="col-sm-2"><asp:TextBox ID="dataFin" runat="server" class="form-control"></asp:TextBox></th>
<th class="col-sm-2">
<asp:DropDownList ID="opcion" runat="server" CssClass="formularioChekLst form-control">
<asp:ListItem>Opciones : </asp:ListItem>
<asp:ListItem>Opción 1</asp:ListItem>
<asp:ListItem>Opción 2</asp:ListItem>
<asp:ListItem>Opcion 3</asp:ListItem>
</asp:DropDownList>
</th>
</tr>
</tbody>
</table>
HTML код
<table class="table table-striped" style="margin:10px" id="tablaSKU" runat="server">
<thead>
<tr>
<th></th>
<th>SKU</th>
<th>Precio €</th>
<th>Descripción</th>
<th>Fecha Inicio Demo</th>
<th>Fecha Fin Demo</th>
<th>Tipo de préstamo</th>
</tr>
</thead>
<tbody>
<tr>
<th>1-</th>
<th class="col-sm-2"><input ID="sku" runat="server" class="form-control"></input></th>
<th class="col-sm-1"><input ID="precio" runat="server" class="form-control"></input></th>
<th class="col-sm-3"><input ID="descripProd" runat="server" class="form-control"></input></th>
<th class="col-sm-2"><input ID="dataInit" runat="server" class="form-control"></input></th>
<th class="col-sm-2"><input ID="dataFin" runat="server" class="form-control"></input></th>
<th class="col-sm-2">
<asp:DropDownList ID="opcion" runat="server" CssClass="formularioChekLst form-control">
<asp:ListItem>Opciones : </asp:ListItem>
<asp:ListItem>Opción 1</asp:ListItem>
<asp:ListItem>Opción 2</asp:ListItem>
<asp:ListItem>Opcion 3</asp:ListItem>
</asp:DropDownList>
</th>
</tr>
</tbody>
</table>
Без кода он не сможет вам помочь. –
Вы посмотрели на jquery? [здесь] (http://stackoverflow.com/questions/463506/how-do-i-get-the-value-of-a-textbox-using-jquery) [здесь] (http://stackoverflow.com/ вопросы/10619445/the-prefered-way-of-create-a-new-element-with-jquery) [здесь] (http://stackoverflow.com/questions/327047/what-is-the-most-efficient- way-to-create-html-elements-using-jquery) [здесь] (http://stackoverflow.com/questions/1481152/how-to-detect-a-textboxs-content-has-changed) даже просто [ищет ] (http://stackoverflow.com/questions/171027/add-table-row-in-jquery?rq=1) по «связанным вопросам» с правой стороны. –
Да, но все они связаны с кнопками. Я хочу, чтобы строка была заполнена, чтобы создать новую. –