Add JS files
This commit is contained in:
25
modules/EcmProducts/javascript/autoIndeks.js
Executable file
25
modules/EcmProducts/javascript/autoIndeks.js
Executable file
@@ -0,0 +1,25 @@
|
||||
var startCode;
|
||||
|
||||
$(document).ready(function () {
|
||||
startCode = $('#code').val();
|
||||
if ($('#code').val() == '') {
|
||||
$('#code').val(genereteCode());
|
||||
}
|
||||
});
|
||||
|
||||
function genereteCode() {
|
||||
var code;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=EcmProducts&action=indeksIncrement&to_pdf=1",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
job: "generateCode",
|
||||
},
|
||||
success: function (data) {
|
||||
code = data;
|
||||
}
|
||||
});
|
||||
return code;
|
||||
}
|
||||
Reference in New Issue
Block a user