Project

General

Profile

« Previous | Next » 

Revision 243e22a9

Added by Jérôme Schneider almost 10 years ago

dossiers: transform form to calebasse ajax form

Fixes forms errors

View differences:

calebasse/static/js/calebasse.dialog.js
76 76
      });
77 77
}
78 78

  
79
/**
80
 * Transform form(s) into your id to ajax forms
81
*/
82
function calebasse_ajax_form(id) {
83
  function onsuccess(response, status, xhr, form) {
84
    $(id).html(response);
85
    $('form').ajaxForm({
86
      success: onsuccess,
87
    });
88
  }
89
  $('form').ajaxForm({
90
    success: onsuccess,
91
  });
92
}
93

  
79 94
function add_dialog(on, url, title, width, btn_text) {
80 95
  // function used to add patient schedules, events and acts
81 96

  
calebasse/static/js/calebasse.dossiers.js
131 131
            '#ajax-dlg', '500px', 'Supprimer');
132 132
    });
133 133
    $('input#id_id-birthdate').datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
134
    calebasse_ajax_form('#tabs-2');
134 135
}
135 136

  
136 137
function load_tab3_addresses() {
......
323 324
}
324 325

  
325 326
function load_tab8_medical() {
327
  calebasse_ajax_form('#tabs-8');
326 328
  SelectFilter.init("id_mises_1", "Catégorie", 0, "/static/admin/");
327 329
  SelectFilter.init("id_mises_2", "Catégorie", 0, "/static/admin/");
328 330
  SelectFilter.init("id_mises_3", "Catégorie", 0, "/static/admin/");

Also available in: Unified diff