Mam następujący problem:

Wdrożyłem następujący skrypt na stronę http://www.aquim.com/web-article-229.html.
Wszystko pięknie funkcjonuje poza jedną rzeczą mianowicie zaimplementowany Nic Edit nie współpracuje z skryptem live.

Skrypt live-edit działa następująco:
Wpisując dane w pole input bądź textarea zapisuje je do określonej komórki w bazie danych bez konieczności skorzystania z buttonu, jednakże gdy zaimplementowałem NicEdit za pole textarea nie zapisuje danych. Prawdopodobnie trzeba zmienić coś w kodzie JS NicEdit (zapewne wystarczy jedną linijkę smile.gif ) bądź sprytnie zmodyfikować liveEdit. O to kody:

Kod JS Live Edit:

  1. <script type="text/javascript">
  2.  
  3. // JQUERY: Plugin "autoSumbit"
  4. (function($) {
  5. $.fn.autoSubmit = function(options) {
  6. return $.each(this, function() {
  7. // VARIABLES: Input-specific
  8. var input = $(this);
  9. var column = input.attr(\'name\');
  10.  
  11. // VARIABLES: Form-specific
  12. var form = input.parents(\'form\');
  13. var method = form.attr(\'method\');
  14. var action = form.attr(\'action\');
  15.  
  16. // VARIABLES: Where to update in database
  17. var where_val = form.find(\'#where\').val();
  18. var where_col = form.find(\'#where\').attr(\'name\');
  19.  
  20. // ONBLUR: Dynamic value send through Ajax
  21. input.bind(\'blur\', function(event) {
  22. // Get latest value
  23. var value = input.val();
  24. // AJAX: Send values
  25. $.ajax({
  26. url: action,
  27. type: method,
  28. data: {
  29. val: value,
  30. col: column,
  31. w_col: where_col,
  32. w_val: where_val
  33. },
  34. cache: false,
  35. timeout: 10000,
  36. success: function(data) {
  37. // Alert if update failed
  38. if (data) {
  39. alert(data);
  40. }
  41. // Load output into a P
  42. else {
  43. $(\'#notice\').text(\'Updated\');
  44. $(\'#notice\').fadeIn().delay(1000).fadeOut();
  45. }
  46. }
  47. });
  48. // Prevent normal submission of form
  49. return false;
  50. })
  51. });
  52. }
  53. })(jQuery);
  54.  
  55. $(function(){
  56. $(\'#ajax-form TEXTAREA\').autoSubmit();
  57. $(\'#ajax-form INPUT\').autoSubmit();
  58.  
  59. });
  60. </script>



NicEdit:
http://chomikuj.pl/martini007/nicEdit,3561044923.js