|
|
|
@ -29,7 +29,7 @@ function deleteTableRow(rowId){
|
|
|
|
|
|
|
|
|
|
var target = document.getElementById("upload-target"+rowId);
|
|
|
|
|
// this.message = app.message;
|
|
|
|
|
var children = target.children;
|
|
|
|
|
// var children = target.children;
|
|
|
|
|
|
|
|
|
|
// delete all uploaded elements
|
|
|
|
|
/* for (var i = 0; i < children.length; i++) {
|
|
|
|
@ -56,6 +56,17 @@ function deleteTableRow(rowId){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function countRows(){
|
|
|
|
|
var ctr=0;
|
|
|
|
|
for (i=0; i<currentRowId; i++){
|
|
|
|
|
var element = document.getElementById("trow"+i);
|
|
|
|
|
if (element)
|
|
|
|
|
ctr++
|
|
|
|
|
}
|
|
|
|
|
return ctr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showAlert(text) {
|
|
|
|
|
|
|
|
|
|
$K.app.message.show( { message: `${text}`, position: 'centered', type: 'is-error' });
|
|
|
|
@ -210,7 +221,7 @@ $K.add('module', 'kaform', {
|
|
|
|
|
opened: function(sender)
|
|
|
|
|
{
|
|
|
|
|
console.log('Tab box is ',sender.getActiveBox());
|
|
|
|
|
this.message.show({ message: 'My message' });
|
|
|
|
|
// this.message.show({ message: 'My message' });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -239,7 +250,38 @@ $K.ajax.get({
|
|
|
|
|
setUploadField();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function check_field(fieldid,message){
|
|
|
|
|
var f = document.getElementById(fieldid).value;
|
|
|
|
|
if (! f.trim().length ) {
|
|
|
|
|
document.getElementById(fieldid).focus();
|
|
|
|
|
showAlert(message)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// add on table row
|
|
|
|
|
//addTableRow();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
function downloadDocument()
|
|
|
|
|
{
|
|
|
|
|
if (!check_field("nickname", "Bitte gib deinen Nicknamen an!"))
|
|
|
|
|
return;
|
|
|
|
|
if (!check_field("realname", "Bitte gib deinen Realnamen an!"))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!check_field("email", "Bitte gib deinen E-Mail-Adresse an!"))
|
|
|
|
|
return;
|
|
|
|
|
if (!check_field("projectid", "Bitte gib idie Projekt-ID an!"))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (countRows()==0){
|
|
|
|
|
document.getElementById("a_type").focus();
|
|
|
|
|
showAlert("Bitte füge mind. eine Auslage hinzu!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.getElementById("theform").submit();
|
|
|
|
|
}
|
|
|
|
|