带编辑的HTML表格 [英] HTML table with Edit

查看:67
本文介绍了带编辑的HTML表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试编辑HTML表数据值。所以我已经生成了一个HTML表格。所以现在我正在尝试将HTML表数据拉到表单..,即我们可以更新表值。



但是当我尝试不能将值拉到表单中。以下是我的代码



txtStr + =''''+ json [i] .id +'' ''+ json [i] .firstName +''''+ json [i] .lastName +''''+ json [i] .licenseId +''''+ json [i] .telephone +'''' + json [i] .email +'''';





Hi

i am trying to edit the HTML table data values. So already i generated a HTML tables. So now i am trying to pull the HTML table data to a form.., i.e thereby we can update the table values.

But when i am trying not able to pull the values to the form. Below is my code

txtStr += '' ''+json[i].id+'' ''+json[i].firstName+'' ''+json[i].lastName+'' ''+json[i].licenseId+'' ''+json[i].telephone+'' ''+json[i].email+'' '';


<tr>
                                       <td><label >id</label></td>
                                       <td align="left"><input type="text" id="editid" class="medium" name="" value=""></td>

                                   </tr>
                                   <tr>
                                       <td><label>firstName</label></td>
                                       <td align="left"><input type="text" id="editfirstname" class="medium" name="" value=""></td>

                                   </tr>
                                   <tr>
                                       <td><label>lastName</label></td>
                                       <td align="left"><input type="text" id="editlastname" class="medium" name="" value=""></td>

                                   </tr>
                                   <tr>
                                       <td><label >licenseId</label></td>
                                       <td align="left"><input type="text" id="editlicenseid" class="medium" name="" value=""></td>

                                   </tr>

                                   <tr>
                                       <td><label>telephone</label></td>
                                       <td align="left"><input type="text" id="edittelephone" class="medium" name="" value=""></td>
                                   </tr>
                                   <tr>
                                       <td><label>email</label></td>
                                       <td align="left"><input type="text" id="editemail" class="large" name="" value=""></td>


                                   </tr>



                                   <tr>
                                      <td colspan="2"><button id="submit" type="button" onClick="Submit();" />Submit</button> or <a href="#">Cancel</a></td>


                                   </tr>

                               </table>

推荐答案

我正在使用AJAX来调用我的Web服务。已经在屏幕上生成了一个HTML表格,其中包含数据。



这是视图表单。每当用户创建新数据时生成数据。



I am using AJAX to Call my Web services. Already a HTML table is generated in the screen with data''s in it.

This is the view form. Every time the data is generated when the user creates a new one.

<h2>View country</h2>   </br>

                                    <div>
                                        <div class="table" id="tab1">

                                            <table class="basic-table" id="mytable">
                                                <thead>


                                                    <tr>
                                                        <th scope="col">id</th>
                                                        <th scope="col">firstName</th>
                                                        <th scope="col">lastName</th>
                                                        <th scope="col">licenseId</th>
                                                        <th scope="col">telephone</th>
                                                        <th scope="col">email</th>



                                                    </tr>


                                                </thead>


                                                </table>

                                                 <label for="search"> <strong>Search Box</strong>
                        </label> <td alihn="left"><input type="text" id="searchTerm" size="20" width="20" onkeyup="doSearch()" />

                                                </div>
                                                </form>







我的回答是拉上表中的数据和以可编辑的形式显示它。我从服务器获得了Json的价值,所以我尝试了以下



txtStr + ='' ''+ json [i] .id +'' ''+ json [i] .firstName +''''+ json [i] .lastName +''''+ json [i] .licenseId +''''+ json [i] .telephone +''''+ json [i] .email +'''';




My answer is to pull the data from the above table & to show it in a form which is editable. I am getting the value in Json from the server, so i tried with the below

txtStr += '' ''+json[i].id+'' ''+json[i].firstName+'' ''+json[i].lastName+'' ''+json[i].licenseId+'' ''+json[i].telephone+'' ''+json[i].email+'' '';


这篇关于带编辑的HTML表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆