File tree Expand file tree Collapse file tree
modules/interventi/modals Expand file tree Collapse file tree Original file line number Diff line number Diff line change 117117 <!-- PULSANTI -->
118118 <div class="row">
119119 <div class="col-md-12 text-right">
120- <button type="submit " class="btn btn-primary"> ' .$ button .'</button>
120+ <button type="button " class="btn btn-primary" onclick="salvaSessione() "> ' .$ button .'</button>
121121 </div>
122122 </div>
123123</form> ' ;
149149 $("#prezzo_dirittochiamata").val(data.prezzo_dirittochiamata);
150150 });
151151});
152+
153+ function salvaSessione() {
154+ // Validazione del form
155+ var valid = $("#add_form").parsley().validate();
156+ if (!valid) {
157+ return false;
158+ }
159+
160+ // Invio dei dati via AJAX
161+ $("#add_form").ajaxSubmit({
162+ url: globals.rootdir + "/actions.php",
163+ data: {
164+ id_module: globals.id_module,
165+ id_record: globals.id_record,
166+ ajax: true,
167+ },
168+ type: "post",
169+ success: function(response) {
170+ renderMessages();
171+
172+ // Chiusura del modale
173+ $("#modals > div").modal("hide");
174+
175+ // Ricaricamento dei costi
176+ caricaCosti();
177+ caricaTecnici();
178+ },
179+ error: function() {
180+ alert(" ' .tr ('Errore durante il salvataggio ' ).'");
181+ }
182+ });
183+ }
152184</script> ' ;
You can’t perform that action at this time.
0 commit comments