akeditable: Jquery inplace editor

March 29th, 2008 | Save to del.icio.us now(0)

Those of you in hurry to download the plugin or source can download it from plugins page of akeditable at jquery .

akeditable: Jquery inplace editor

This is the plugin based on jEditable plugin created by Tuupola and Dylan Verheul. The purpose of create this plugin was to specifically solve the problem that i was facing, ie to give my users option button to save and or cancel, instead of using enter to save the content.

I will not say that akeditable is any improvement over jEditable, which is far better then what i have done. akeditable was meant to be used with situations similar to the way i have used it in celsias project or people section.

It works in exactly same fashion as jEditable, ie you click on the text to edit or a link and it converts the area into a from. Check out the live demo.

How To Use It

  1. It is very simple, just call the akedit on click function of the element you want to convert in to editable area with the ID of the element.
    <div id="editme" onclick="akedit('ajax.php?mode=eg1','editme',{
    type : 'textarea',
    name : 'usercomment',
    width: '232px',
    height: '80px',
    submit:'save'
    });"> THIS IS EDITABLE ON CLICK
    </div>
  2. Parameter to akedit function is the url: where you want to post the form data, the id of the element you want to convert into editable area and settings as hash like the value for submit button and other stuff.
    akedit('ajax.php?mode=eg1','editme',{
         type : 'textarea',
         name : 'usercomment',
         width: '232px',
         height: '80px',
         submit:'save'
    });
  3. That’s it you are done.

Processing On Server

  1. you get the post data as
    1. id, the id of the div you were editing and,
      id	editme
  2. <name that you specified in the setting> , which contains the value that user typed in the textarea or textbox.
    usercomment	THIS IS EDITABLE ON CLICK i added this

    Update(25 August 2009):Released the new version 1.1 of the plugin, and also made it compatible with jQuery 1.3.x

    Related posts

    1. akWpLightBox : simple lightbox for wordpress
    2. akeditable: Jquery inplace editor
    3. akModal: simplest alternative to thickbox
    4. akslideshow
    5. TubeSpy by Ajaxonomy

    Wondering what to do next?


    (Search web development related contents)


    35 Responses to “akeditable: Jquery inplace editor”

    1. April 2, 2008 5:24 pm Brève 14: jQuery, wallpaper, CSS, listes … says

      [...] akeditable: Jquery inplace editor | am i works? Voici un petit plugin jQuery qui vous permet de faire de l'édition live [...]

    2. August 26, 2008 6:54 am Сергей says

      in opera 9.52 the button of cancel does not work

    3. September 27, 2008 5:55 am Gaurav Bansal says

      Hi Amit,

      It was nice to meet you at PHP Camp. I want to seek your help for a PHP based web application that I am currently developing. Can you mail me your phone no./ email address on which I can touch base with you.

      Thanks
      Gaurav

    4. September 27, 2008 6:15 am Amit Kumar Singh says

      @gaurav you can find my details at phpcamp.org, or phpcamp google group.

      cheers

    5. October 27, 2008 10:11 am Vineeth says

      Its a good work. How can i use combo box instead of text area??

    6. October 27, 2008 10:13 am Vineeth says

      how can i use combo box instead of text area??

    7. October 27, 2008 11:00 am Amit Kumar Singh says

      @vineeth for that you will need to modify the source code to use select tag instead of input tag

    8. October 28, 2008 11:54 am Vineeth says

      Hi Amit,

      I am not familiar with JavaScript. Can you tell me how can i write those codes.
      Thanks for your support.

    9. October 28, 2008 12:34 pm Amit Kumar Singh says

      @Vineeth sorry man, but if you don’t know JS i can’t help much. It would be better if you ask your colleagues or friends in this one.

    10. October 30, 2008 12:30 pm Vineeth says

      Ok Amit. i will try.

    11. November 10, 2008 6:15 pm Houser says

      The cancel button is not working in Chrome or the latest version of FireFox

    12. November 13, 2008 1:44 am Houser says

      Okay, I found the error on the cancel button. In brief, the cancel button click event is spilling over (bubbling) up to the containing DIV element. To prevent this, the following code needs to be modified:

      b.onclick =function(e){
      reset(old_content,objtoedit);
      }

      To this:

      b.onclick =function(e){
      if(window.event)
      e = window.event;

      try {
      e.stopPropagation();
      }
      catch(err){
      try {
      e.cancelBubble = true;
      }
      catch(err2){}
      }

      reset(old_content,objtoedit);
      }

    13. November 13, 2008 7:23 am Amit Kumar Singh says

      @houser thanks, I am sure it will help others.. I will update the code and release it sometime soon.

    14. December 6, 2008 7:32 am Jimmy says

      is there any way to add an “oncomplete” response? eg. when the server side portion is completed, a message saying “Commented Updated” could appear above the textarea that was edited

    15. December 10, 2008 7:56 am Amit Kumar Singh says

      @Jimmy nice idea, thanks. for now you have to modify the source to add oncomplete.

    16. February 5, 2009 9:09 pm utsav singh rathour says

      hey I needed some help updating data on database with akeditable. I send the value as
      ———————-
      <a style=”margin-left:3px;color:red;float:left;” href=”javascript:void(null);” onclick=”akedit(‘ajax.php?mode=eg1&id=’,'akusercomment’,{
      type : ‘text’,
      name : ‘usercomment’,
      width: ’232px’,
      height: ’80px’,
      submit:’save’
      });”>Edit
      ———————————————-
      and get the value in ajax.php as
      —————————————–
      if($sql=mysql_query(“update advertisement set link = ‘$data’ where id=’$_REQUEST[id]‘”) or die(“Could Not Find the Table named advertisement”))
      —————————————–
      it doesnot update the db and $_REQUEST[id] returns “akusercomment”. wht do i do? I need urgent help.

    17. February 5, 2009 9:29 pm Amit Kumar Singh says

      i think something is wrong here id=’,’akusercomment’ check if quotes are proper.

    18. February 6, 2009 6:47 pm Utsav singh rathour says

      sorry for wrong question!!
      i put on click event as:
      ’ajax.php?mode=eg1&id=’,’akusercomment’

      but when i echo id on ajax.php it shows “akusercomment”

    19. February 8, 2009 8:45 pm Utsav singh rathour says

      Please reply to my question

    20. February 20, 2009 10:14 am jquery plugins by name « Web Developer says

      [...] you can check for details at http://amiworks.co.in/talk/akeditable-jquery-inplace-editor/ [...]

    21. June 22, 2009 11:47 pm th says

      Can this be run through asp.net? If so anyway you could show an example?

    22. June 26, 2009 12:45 am mickey says

      I have problems with the TAG in the text, is there a way to solve the problem

    23. June 26, 2009 12:57 am mickey says

      i solved my problem

      find i.value=old_content; and add this line obove it.

      var old_content = old_content.replace(//gi, “\n”);

    24. August 18, 2009 2:56 pm Utsav Singh Rathour says

      Hey it works good for me now. but i have one more problem using it. As of now, i need it to work with the input type “file”. i.e. i want to update file using this and i think it is caused since to upload we need to set the form enctype to “multipart/formdata”. but where do i do it?

    25. August 25, 2009 5:29 pm Amit Kumar Singh says

      @utsav find “f = document.createElement(‘form’);” you can add after this.

    26. August 26, 2009 6:32 pm Matus says

      Thank you for the plug-in, this is exactly what i was looking for! Small & simple & effective.
      However your parameters don’t match the actual settings in the script. What i mean is, in every example (even those included in the .zip) the params ‘width’ and ‘height’ do not affect the size of the textearea, instead you have to use ‘rows’ and ‘cols’. You should change your documentation and/or the script.
      Thanks anyway!

      And an idea BTW, it would be nice if one could assign a CSS-class to the Save/Cancel buttons (or style them somehow).

    27. September 6, 2009 1:26 am Teodor says

      Thanks for this plugin, just what i was looking for.

    28. September 13, 2009 1:41 am Marcin says

      It don’t save modified text… How to make it work only for administrator, not everybody?

    29. September 13, 2009 11:08 am Amit Kumar Singh says

      @marcin yes, this is JS.. it can’t save.. you need to write the code in PHP or other backend language to save the modified text.

    30. September 14, 2009 2:29 pm Marcin says

      Poor, it’s too complicated for me :( Maybe there are some existing examples?

    31. October 4, 2009 10:01 pm akeditable: Jquery inplace editor Plugin | jQuery Wisdom says

      [...] as jEditable, ie you click on the text to edit or a link and it converts the area into a from Web Site Demo Download AKPC_IDS += "568,";Popularity: 1% [?] Share and [...]

    32. April 22, 2010 2:46 pm wespai says

      nice plugin

    33. May 3, 2010 8:01 pm sahu says

      amit ji its not working in ie its working fine in mozilla how to resolve can u help?
      thank u

    34. August 1, 2010 2:18 am ANKARA WEB TASARIM says

      opera not work :(

    35. September 13, 2010 1:02 pm Turning Point » Blog Archive » Web Available UI, Nonflash – 웹에서 응용 가능한 UI says

      [...] Inplace Edit 보기 [...]

    Trackback URI | Comments RSS

    Say Something, and Be Counted

    Name (required)

    Email (required)

    Website

    Speak your mind