Results 1 to 3 of 3

Thread: Seeking an inline edit script that saves data

  1. #1
    Join Date
    Feb 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Seeking an inline edit script that saves data

    I've found a number of inline editing scripts but none of them saves the data when you refresh the page. Does anyone know where I could find a script that allows users to modify one line of text on a page but that modified data is saved when the user refreshes or returns to the page? I can't seem to find anything that does this. I'd prefer a solution that uses jQuery or standalone JS.

    Thank you!

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    Do you have any server-side scripting languages available? I'll assume PHP for now. Ask questions!
    1. On the page, put the line of text in an <input type="text> and put the element in a form.
    2. Make a PHP script which saves your one line of text.
    3. Set the page itself as the form's action, and when the form is submitted call the above script.
    4. When the page loads, use JavaScript to:
      1. Preserve the input element and replace it with a <span>.
      2. Set an onclick listener on the span which replaces the span with the input element.
      3. Set an onsubmit listener on the form which uses AJAX to call the PHP script, replace the input with the span, and return false.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  3. #3
    Join Date
    Feb 2008
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That's what I was thinking but was hoping there'd be an open source bundle out there rather than try to do it from scratch. Time constraints and what not. If I come up with anything concrete, I'll post my findings. Thanks for your quick response. Love this board!

    Cheers

Bookmarks

Posting Permissions

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