Click here to Skip to main content
14,736,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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>
Posted
Updated 11-Mar-13 23:39pm
v2
Comments
Jameel VM 12-Mar-13 4:44am
   
Please post the code what you have tried for pull the data from Table

1 solution

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>



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+' ';
   

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