click, edit and save text script without refreshing page?
i'm looking for a script that will allow the users to click and edit text then save without reloading the page.
Sample user text. (when user click on the text it turns into an editable field that they can change, then maybe a save button appears too or something to save changes to the database)
Use an onChange event on the textbox, or onChange with onKeydown on a certain interval (after about 5 seconds of no change would be good), and then save that data to the server by submitting through an image.
When the page loads, just get the text from the file and load it into the textbox, with PHP. Easy.
<?php echo file_get_contents('my.txt'); ?>
The PHP image script will display the image in the end, but also save the data from the $_GET['val'] variable.
$f = fopen('text.txt','w+');
tech_support (another user here) and I had a working example of this a while ago on his server. I think he probably still has a copy. I'll ask him to post that.
Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I know this is an old threadw...
Do you still have this?
I'm looking for something like this.
Sorry for feeding an old thread.
I have attached a script that might work for you.
I'll look at it when I get home after working in the morning.
I found this download and its very useful but I would like to adapt it further and need some help.
I've edited the save.php file with a code snippet to work with php4 but I dont really know that much about php to adapt the script to work on an editable area within the index.php page itself rather than reading and changing content in an external contents.txt file.
So, I'd like to edit an editable div in index.php and save it to index.php (not the external contents.txt file)
It also needs to be compatiable with php4
Can anybody offer any coding assistance please?
Ok - I've done some more Googling and come across this code which might be an alternative to the editor429_v2.zip download above. (The edito429 script is my first choice but the code below also does a similar job and I'm sure could be adapted to my needs)
Code is here: http://codingforums.com/showthread.php?p=768811
Example editable page is here: http://edit.awardspace.co.uk/
The problem is at the moment, when you go into edit mode, you can see and edit all the html tags - what I would really like is for the edit page to just show the content as defined within an editable area rather than the whole web page structure.
I have no idea how to adapt the code to target and pluck out the contents of a named div for example so if somebody could offer some assistance, I would be very grateful.
Last edited by Beverleyh; 07-22-2009 at 10:34 AM.
Reason: additional information added