Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX Inline Editing: Add PHP Update to new changes
    text
    copied!<p>I’m working on a homepage and will use an AJAX inline editing script for the admin to make it as simple as possible. The script I’ve been using is <a href="http://valums.com/edit-in-place/" rel="nofollow noreferrer">this</a> and it has almost everything I wanted from an inline editing script. My problem arises when I’m going to capture the new changes and send them to a PHP function which will update my database with those new changes.</p> <p>I don’t have that much experience with AJAX and PHP together so I’m somewhat lost but I’ve tried a code I found:</p> <pre><code>$.ajax({ type: "POST", url: "update_handler.php", data: "newfieldvalue=" + newValue, success: function(msg){ alert( "Data Saved: " + msg ); } }); </code></pre> <p>The problem is that I don’t quite know how or where to implement this code or if it’s even the right code to use. To show you the code I’ve attached two txt documents:</p> <p><a href="http://dl.dropbox.com/u/70953/inline_editing/index.php.txt" rel="nofollow noreferrer">Index.php.txt</a></p> <p>And</p> <p><a href="http://dl.dropbox.com/u/70953/inline_editing/jquery.editableText.js.txt" rel="nofollow noreferrer">Jquery.editableText.js.txt</a></p> <p>In <code>index.php.txt</code> is the index page where it retrieves my data from the database and uses a bit of jQuery code. In the <code>jQuery.editableText.js.txt</code> is the concrete jQuery code. I guess that the PHP handler page is pretty much standard with taking the correct field and then update it in the database.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload