Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is my Ajax code
JavaScript
function AppViewModel() {
                $('#form').submit(function(){
                    $.ajax( {
                        url : '...',
                        data:JSON.stringify(data), 
                        method : 'GET',
                        success: function(date) { //you need to append the data to gridview
                            for (var i = 0; i < 10; i++) {
                                $("#text").append("<table><tbody><tr><td>" + date[i].Text1 + 
                                                            "</td><td>" + date[i].Text2 + "</td></tr></tbody></table>");
                            }
                        }});
                })

This is my HTML code

HTML
   <form id="form" method="get" >
   <table >
 <tr><td>First name</td><td> <input type="text" class="inputs" id="first"/></td></tr>
    <tr><td>Last name</td><td> <input type="text" class="inputs" id="Text1" /></td></tr>
    <tr><td>Dob</td><td><input type="text" id="datepicker"/></td></tr>
    <tr><td>Description</td><td> <textarea rows="5" cols="17" class="inputs" id="Text3" ></textarea></td></tr>
       <tr><td><input type="button" value="submit" onclick="AppViewModel()" id="text" /></td></tr>
        </table>
</form>
        <div id="date"></div>
Posted
Updated 22-Jun-14 21:52pm
v2
Comments
Kornfeld Eliyahu Peter 23-Jun-14 5:24am    
And the question is?
SRS(The Coder) 26-Jun-14 5:51am    
Please explain bit, what you really want to achieve here ?

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