tags:

views:

510

answers:

3

Hi, How to insert into database on every editInplace in JQuery..

               <script type="text/javascript">
                   var increment = 0;
  $(document).ready(function(){
                       $(".menu a").click(function () {
                        increment++;
   $("<div> Label </div>").appendTo(".menu li").addClass("div" + increment);
              $(".div" + increment).show(function () {
      $(".div" + increment).editInPlace({
    url: "./server",
    show_buttons: true
           });//editinplace

             });//show
               });//click
            });
    </script>
+2  A: 

You can't insert into a database using only JQuery. You must use AJAX to send the data to the server and then, there, insert into the database.

Gonzalo Quero
A: 

The best way to insert into a database with Jquery is to use Jquery to call on a page which has some other code on it, that can easily insert into a database.

The most common way to do this is to use PHP and Jquery's post/get/ajax features to call on a page that has the PHP code used to insert into the database.

Sam
A: 

You can use asp.net page methods to handle the ajax request from edit-in-place and handle pushing info into database in that method. I'm doing this in my current project and it is really a charm for user, because they don't have to refresh whole page for small changes!!!

TheVillageIdiot