Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default Scriptaculous InPlaceEditor

    I currently have this working, but I need to implement it into a while() loop. So i'd do like
    PHP Code:
    <?PHP while ($ary mysql_fetch_array($qry))
    {
    echo 
    "<span id='editme'>$ary['name']</span>";
    }
    ?>
    <script>
    new Ajax.InPlaceEditor($('editme'), 'test.php', {okButton: false, okLink: true, cancelLink: true, cancelButton: false,okText: "Update", cancelText: "Oops", highlightcolor: "#CD5555", highlightendcolor: "#000000"});
    </script>
    which would obviously display all of the names in the table from the database and make all of them editable. This is my problem, how can I let the processing page know which id each name is? Like they would all have ID's within the database. Because as far as i can see, it only parses on the $_POST['value'] value to the processing page? Probably a really dumb question, but ya know its late. Any help would be really appreciated I think it all makes sense?:s
    Joe
    Last edited by Joe!; 27-11-2008 at 11:38 PM.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  2. #2
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    Solved it
    If anyone wants to know, you have to specify your parameters, which I did by doing this
    PHP Code:
    new Ajax.InPlaceEditor('item_<?php echo $item['id'];?>', 'test.php',{callback: function(form, value) { return 'name=' + escape(value)+'&id=<?php echo $item['id'];?>'}});
    then it just sends $_POST['name'] * $_POST['id']
    If a moderator could close this thread now please =]
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


Posting Permissions

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