Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Norm

Thread: Grab and replace (exchange) value

  1. #1
    ebc_Hosting is offline Member
    Join Date
    Jan 2012
    Location
    Serbia
    Posts
    2
    Rep Power
    0

    Question Grab and replace (exchange) value

    Based on this example:
    Dynamic Drag’n Drop With jQuery And PHP

    I tried to make a replacement football players in the right manager

    in link belowe:
    http://www.sportskevesti.co/component/m ... /index.php

    this is what i can do (sort). and this is something, but not good enough. Can someone help me how to this technique(jquery) make a real change of players(substitution) instead of sorting, (example in upper link)

    thanks

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,332
    Rep Power
    25

    Default Re: Grab and replace (exchange) value

    Is this a java programming problem?
    If so, please post your code and your questions.

  3. #3
    ebc_Hosting is offline Member
    Join Date
    Jan 2012
    Location
    Serbia
    Posts
    2
    Rep Power
    0

    Default Re: Grab and replace (exchange) value

    Sorry

    (this is my first java attempts on this example)

    I try to make online sooccer manager, and for that, i mast make soccer player substitution.
    Becose of that, i search for Drag and Drop rutine, and i find this example:

    Dynamic Drag’n Drop With jQuery And PHP:

    The JavaScript:
    ---------------------------------
    <script type="text/javascript">
    $(document).ready(function(){

    $(function() {
    $("#contentLeft ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {
    var order = $(this).sortable("serialize") + '&action=updateRecordsListings';
    $.post("updateDB.php", order, function(theResponse){
    $("#contentRight").html(theResponse);
    });
    }
    });
    });

    });
    </script>
    PHP part of code:
    ----------------------------------
    <?php
    require("db.php");

    $action = $_POST['action'];
    $updateRecordsArray = $_POST['recordsArray'];

    if ($action == "updateRecordsListings"){

    $listingCounter = 1;
    foreach ($updateRecordsArray as $recordIDValue) {

    $query = "UPDATE records SET recordListingID = " . $listingCounter . " WHERE recordID = " . $recordIDValue;
    mysql_query($query) or die('Error, insert query failed');
    $listingCounter = $listingCounter + 1;
    }

    echo '<pre>';
    print_r($updateRecordsArray);
    echo '</pre>';
    echo 'If you refresh the page, you will see that records will stay just as you modified.';
    }
    ?>
    This is drag, drop sortable example

    And I need to do an example in which I will replace the players and not move one below the other.

    Thanks for the quic answer :)

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,332
    Rep Power
    25

    Default Re: Grab and replace (exchange) value

    I don't see any java code.
    Java is not javascript.
    quad64bit likes this.

Similar Threads

  1. How to grab directory from a JFileChooser?
    By blackbird in forum AWT / Swing
    Replies: 5
    Last Post: 07-16-2011, 07:03 AM
  2. Replies: 10
    Last Post: 07-08-2011, 08:21 AM
  3. how to grab info from array
    By skuzzie in forum New To Java
    Replies: 3
    Last Post: 12-09-2010, 01:26 PM
  4. Trying to login to a website then grab another page
    By DaveTheAve in forum New To Java
    Replies: 6
    Last Post: 04-14-2010, 09:44 PM
  5. grab the textfile
    By Sticks_ll in forum New To Java
    Replies: 3
    Last Post: 03-31-2009, 01:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •