Submitting data to database after drag and drop.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tarunkhatri
    New Member
    • Sep 2009
    • 36

    Submitting data to database after drag and drop.

    Hi , I am really confused that how to submitted data back to the database with respective to the drag and drop happened on the client level. Below is my detailed problem.

    I have three DIV containers containting various div's holiding the value coming from the database. So on the 1st load all the div containers have the values coming from the database. As soon as the data populated I provide the functionality of moving a div from one container to another. SO after all the drag and drops I want the database to be updated as values in 1st div container have different status that value in 2nd div container.

    So just want some way to dynamically change the status as soon as div moves to different container. Following is some part of my code that may help understanding the problem.

    Code:
    <fieldset id="Demo4"> 
    <div> 
    <div class="DragContainer" id="DragContainer4" overclass="OverDragContainer"> 
    
    <?php
    for ($i = 0; $i < $n; $i ++)
    	{
    	?>	
            <div class = "DragBox" id="Item<?php echo $i ?>" overclass="OverDragBox" dragclass="DragDragBox"><input type="text" name ="team<?php echo $i ?>" value="<?php echo $team2['employee_name'] ?>"  size = "9""></div>
      <?php 
    $team2 = pg_fetch_assoc($team1);
      } 
    ?>
    </div>
    <div class="DragContainer" id="DragContainer5" overclass="OverDragContainer"> 
    <?php
    for ($J = 0; $J < $nn; $J ++)
    	{
    	?>	
            <div class = "DragBox" id="Item<?php echo $i ?>" overclass="OverDragBox" dragclass="DragDragBox"><input type="text" name ="team<?php echo $i ?>" value="<?php echo $already_allocated2['employee_name'] ?>"  size = "9""></div>
      <?php 
    $already_allocated2 = pg_fetch_assoc($already_allocated1);
    $i = $i + 1;
      } 
    ?>
    </div> 
    <div class="DragContainer" id="DragContainer6" overclass="OverDragContainer"> 
    </div>
    </div>
    </fieldset>
    Many Thanks in advance
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    all you can do is extending the javascript to notify the database of any changes it makes. (guess that’s an AJAX job)

    Comment

    • tarunkhatri
      New Member
      • Sep 2009
      • 36

      #3
      Is there no way to do it by php ? as dnt knw anything abt AJAX

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        PHP will have to do the work on the server side, but anything you do client side (in the browser), cannot be handled by PHP.

        Comment

        Working...