jQuery Drag Drop - how to fetch the dropped value in the server end? -


i have application uses jquery ui drag li 1 ul another. asp code same follows:

<script type="text/javascript" src="../../jquery/jquery-1.3.2.js"> </script>  <script type="text/javascript" src="../../jquery/ui.core.js"> </script>  <script type="text/javascript" src="../../jquery/jquery-ui-1.5.3.custom.min.js"> </script>  <script type="text/javascript">     $(function() {         $("#selectedusers").sortable({ connectwith: ["#userlist"] });         $("#userlist").sortable({ connectwith: ["#selectedusers"] });     }); </script> 

  tea coffee juice user list

                    </ul>                 </div>             </div>             <asp:label id="lbldisplay" runat="server"></asp:label>             <asp:button id="btnsubmit" runat="server" text="submit"                 />         </div>     </asp:panel> </div> 

my question is.. how capture dropped li element @ server end? wanted jquery return id/value of dropped li server end..

thanks in advance

you need specify "receive" event handler when dragged item received, such as

$("#selectedusers").sortable({      connectwith: ["#userlist"],     receive: function(event, ui) {        objectmoved(ui.sortable, this);     } });  function objectmoved(obj, newcontainer) {    /* here either perform sort of ajax request,     * or dynamically add/update form-field posting if     * doing standard form submission     */ } 

you'll need attach same receive event "userlist"

note haven't used "sortable" ui helper before, should similar principle "draggable" , "droppable", , i've based example on know these other 2 helpers - if it's not entirely correct, should close.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -