<!doctype html>
<html>
<head>
<base href="/">
<script src="/dmxAppConnect/dmxAppConnect.js"></script>
<meta charset="UTF-8">
<title><%=_('\'Additions to Database\'')%></title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" crossorigin="anonymous" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="/bootstrap/5/css/bootstrap.min.css" />
<link rel="stylesheet" href="/css/style.css" />
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="/dmxAppConnect/dmxRouting/dmxRouting.js" defer></script>
<script src="/dmxAppConnect/dmxBootstrap5Navigation/dmxBootstrap5Navigation.js" defer></script>
<script src="/dmxAppConnect/dmxFormRepeat/dmxFormRepeat.js" defer></script>
<link rel="stylesheet" href="/dmxAppConnect/dmxSummernote/summernote-bs5.min.css" />
<script src="/dmxAppConnect/dmxSummernote/summernote-bs5.min.js" defer></script>
<script src="/dmxAppConnect/dmxSummernote/lang/summernote-de-DE.js" defer></script>
<script src="/dmxAppConnect/dmxSummernote/dmxSummernote.js" defer></script>
<link rel="stylesheet" href="/dmxAppConnect/dmxDropzone/dmxDropzone.css" />
<script src="/dmxAppConnect/dmxDropzone/dmxDropzone.js" defer></script>
<script src="/dmxAppConnect/dmxSummernoteFileUpload/summernote-upload.js" defer></script>
<link rel="stylesheet" href="/dmxAppConnect/dmxValidator/dmxValidator.css" />
<script src="/dmxAppConnect/dmxValidator/dmxValidator.js" defer></script>
<script src="/dmxAppConnect/dmxBootstrap5Tooltips/dmxBootstrap5Tooltips.js" defer></script>
<link rel="stylesheet" href="/dmxAppConnect/dmxNotifications/dmxNotifications.css" />
<script src="/dmxAppConnect/dmxNotifications/dmxNotifications.js" defer></script>
<script src="/dmxAppConnect/dmxBrowser/dmxBrowser.js" defer></script>
<script src="/dmxAppConnect/dmxBootstrap5Offcanvas/dmxBootstrap5Offcanvas.js" defer></script>
<link rel="stylesheet" href="/dmxAppConnect/dmxBootstrap5TableGenerator/dmxBootstrap5TableGenerator.css" />
<script src="/dmxAppConnect/dmxFormatter/dmxFormatter.js" defer></script>
<link rel="stylesheet" href="/dmxAppConnect/dmxAnimateCSS/animate.min.css" />
<script src="/dmxAppConnect/dmxAnimateCSS/dmxAnimateCSS.js" defer></script>
<script src="/dmxAppConnect/dmxStateManagement/dmxStateManagement.js" defer></script>
<script src="/dmxAppConnect/dmxBootstrap5PagingGenerator/dmxBootstrap5PagingGenerator.js" defer></script>
<script src="/dmxAppConnect/dmxBootstrap5Modal/dmxBootstrap5Modal.js" defer></script>
</head>
<body is="dmx-app" id="main" style="--bs-body-bg: #fcfcfc;" class="style90">
<div is="dmx-browser" id="browser1"></div>
<dmx-notifications id="notifies_success" align="center" offset-y="500" timeout="2500" closable="true" show-duration="250"></dmx-notifications>
<dmx-serverconnect id="conn_get_month_single" url="/api/datacall/datacallsinglemonth" noload="true"></dmx-serverconnect>
<dmx-serverconnect id="conn_remove_record" url="/api/dataremove/dataremove" noload="true"></dmx-serverconnect>
<dmx-serverconnect id="conn_get_single_rec" url="/api/datacall/datacall_singlerecord" noload="true" dmx-param:additions_id=""></dmx-serverconnect>
<dmx-serverconnect id="conn_logout" url="/api/security/logout" noload="true"></dmx-serverconnect>
<dmx-serverconnect id="conn_datacall_paged" url="/api/datacall/datacall_paged" dmx-param:offset="query.offset" dmx-param:limit="9"></dmx-serverconnect>
<dmx-query-manager id="query1"></dmx-query-manager>
<div class="modal border-0 fade" id="modal1" is="dmx-bs5-modal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header shadow-none border-0 bg-warning">
<h5 class="modal-title fw-light">Datensatz entfernen?</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body shadow-none bg-body-tertiary">
<input id="text1" name="text1" type="text" class="form-control visually-hidden" readonly="true">
<input id="text2" name="text2" type="text" class="form-control form-control-sm mt-3" readonly="true" dmx-bind:value="">
</div>
<div class="modal-footer border-0 bg-light">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-bs-target="#modal1" dmx-on:click="modal1.hide()">Close</button>
<button type="button" class="btn btn-danger" dmx-on:click="run([{run:{outputType:'text',action:`conn_remove_record.load({additions_id: text1.value})`}},{run:{outputType:'text',action:`notifies_success.success(\'Erfolgreich gelöscht\')`}},{wait:{delay:1000}},{run:{outputType:'text',action:`modal1.hide()`}},{run:{outputType:'text',action:`conn_datacall_paged.load({})`}}])">Entfernen</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal2" is="dmx-bs5-modal" tabindex="-1">
<div class="modal-dialog modal-sm modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header border-0">
<h5 class="modal-title fw-light">Möchten Sie sich abmelden?</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p class="fw-lighter">Sie werden erneut zur Anmeldeseite weitergeleitet...</p>
</div>
<div class="modal-footer border-0">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary bg-danger" dmx-on:click="run([{run:{outputType:'text',action:`notifies_success.warning(\'Logout...\')`}},{wait:{delay:2000}},{run:{outputType:'text',action:`conn_logout.load({})`}},{run:{outputType:'text',action:`browser1.goto(\'/login\')`}}])">Logout</button>
</div>
</div>
</div>
</div>
<div class="offcanvas offcanvas-end bg-secondary bg-opacity-50 rounded-start rounded-2 style77 w-auto d-none d-lg-block" id="offcanvas_datacall_paged1" is="dmx-bs5-offcanvas" tabindex="-1">
<div class="offcanvas-header style76 pt-1">
<button id="btn4" class="btn text-white btn-sm mt-2" dmx-animate-enter="bounceIn" dmx-on:click="offcanvas_datacall_paged1.hide()"><i class="fas fa-window-close fa-2x"></i></button>
<h5 class="offcanvas-title text-light ms-xl-2 ms-lg-2 ms-md-2 mt-1 ms-2 ms-sm-2 mt-xxl-1 ms-xxl-3">frühere Einträge</h5>
</div>
<div class="offcanvas-body pt-1">
<div class="table-responsive">
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th scope="row" class="pt-2 pb-2 bg-body-secondary style79">undefined</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">ID</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Assetname</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Datum hinzugefĂĽgt</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary visually-hidden">Additions asset</th>
<th scope="row" class="fw-light bg-body-secondary pt-2 pb-2">Monat und Jahr</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Tendenz</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Tendenz Chance</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Tendenz Risiko</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary d-none d-lg-table-cell">Bemerkungen</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Stoploss</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Takeprofit</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary visually-hidden">Assetname</th>
</tr>
</thead>
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="conn_datacall_paged.data.query.data" id="tableRepeat2">
<tr>
<td class="bg-body-tertiary">
<button id="modalbtn1" class="btn text-danger mb-2" dmx-on:click="run([{run:{outputType:'text',action:`modal1.show()`}},{run:{outputType:'text',action:`modal1.text1.setValue(additions_id)`}},{run:{outputType:'text',action:`modal1.text2.setValue(\'Record: \'+additions_id+\', hinzugefĂĽgt: \'+added_date.formatDate(\'dd-MM-yyyy HH:mm\')+\', mit Ware: \'+assetname_DE)`}}])"><i class="far fa-times-circle fa-lg"></i></button>
</td>
<td class="bg-body-tertiary pt-2" dmx-text="additions_id"></td>
<td class="bg-body-tertiary pt-2" dmx-text="assetname_DE"></td>
<td class="bg-body-tertiary pt-2" dmx-text="added_date.formatDate('dd-MM-yyyy HH:mm')"></td>
<td class="bg-body-tertiary visually-hidden pt-2" dmx-text="additions_asset_id"></td>
<td class="bg-body-tertiary pt-2" dmx-text="monat_jahr"></td>
<td class="bg-body-tertiary pt-2" dmx-text="tendenz"></td>
<td class="bg-body-tertiary pt-2" dmx-text="tendenz_chance"></td>
<td class="bg-body-tertiary pt-2" dmx-text="tendenz_risk"></td>
<td class="bg-body-tertiary d-none d-lg-table-cell pt-2" dmx-text="remarks.trunc(50, 'true', '...')"></td>
<td class="bg-body-tertiary pt-2" dmx-text="stoploss"></td>
<td class="bg-body-tertiary pt-2" dmx-text="takeprofit"></td>
<td class="bg-body-tertiary visually-hidden pt-2" dmx-text="assetname_EN"></td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="pagination mt-2" dmx-populate="conn_datacall_paged.data.query" dmx-state="query1" dmx-offset="offset" dmx-generator="bs5paging">
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == 1" aria-label="First">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.first)"><span aria-hidden="true">‹‹</span></a>
</li>
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == 1" aria-label="Previous">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.prev)"><span aria-hidden="true">‹</span></a>
</li>
<li class="page-item" dmx-class:active="title == conn_datacall_paged.data.query.page.current" dmx-class:disabled="!active" dmx-repeat="conn_datacall_paged.data.query.getServerConnectPagination(2,1,'...')">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',(page-1)*conn_datacall_paged.data.query.limit)">{{title}}</a>
</li>
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == conn_datacall_paged.data.query.page.total" aria-label="Next">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.next)"><span aria-hidden="true">›</span></a>
</li>
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == conn_datacall_paged.data.query.page.total" aria-label="Last">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.last)"><span aria-hidden="true">››</span></a>
</li>
</ul>
</div>
</div>
<div class="offcanvas offcanvas-end bg-secondary bg-opacity-50 rounded-start rounded-2 style77 d-lg-none w-auto" id="offcanvas_datacall_paged2" is="dmx-bs5-offcanvas" tabindex="-1">
<div class="offcanvas-header style76 pt-1">
<button id="btn1" class="btn text-white btn-sm mt-2" dmx-animate-enter="bounceIn" dmx-on:click="offcanvas_datacall_paged2.hide()"><i class="fas fa-window-close fa-2x"></i></button>
<h5 class="offcanvas-title text-light ms-xl-2 ms-lg-2 ms-md-2 mt-1 ms-2 ms-sm-2 mt-xxl-1 ms-xxl-3">frühere Einträge</h5>
</div>
<div class="offcanvas-body pt-1">
<div class="table-responsive">
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th scope="row" class="pt-2 pb-2 bg-body-secondary style79">undefined</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">ID</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Assetname</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Datum hinzugefĂĽgt</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary visually-hidden">Additions asset</th>
<th scope="row" class="fw-light bg-body-secondary pt-2 pb-2">Monat und Jahr</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Tendenz</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Tendenz Chance</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Tendenz Risiko</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary d-none d-lg-table-cell">Bemerkungen</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Stoploss</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary">Takeprofit</th>
<th class="fw-light pt-2 pb-2 bg-body-secondary visually-hidden">Assetname</th>
</tr>
</thead>
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="conn_datacall_paged.data.query.data" id="tableRepeat1">
<tr>
<td class="bg-body-tertiary">
<button id="modalbtn2" class="btn text-danger mb-2" dmx-on:click="run([{run:{outputType:'text',action:`modal1.show()`}},{run:{outputType:'text',action:`modal1.text1.setValue(additions_id)`}},{run:{outputType:'text',action:`modal1.text2.setValue(\'Record: \'+additions_id+\', hinzugefĂĽgt: \'+added_date.formatDate(\'dd-MM-yyyy HH:mm\')+\', mit Ware: \'+assetname_DE)`}}])"><i class="far fa-times-circle fa-lg"></i></button>
</td>
<td class="bg-body-tertiary pt-2" dmx-text="additions_id"></td>
<td class="bg-body-tertiary pt-2" dmx-text="assetname_DE"></td>
<td class="bg-body-tertiary pt-2" dmx-text="added_date.formatDate('dd-MM-yyyy HH:mm')"></td>
<td class="bg-body-tertiary visually-hidden pt-2" dmx-text="additions_asset_id"></td>
<td class="bg-body-tertiary pt-2" dmx-text="monat_jahr"></td>
<td class="bg-body-tertiary pt-2" dmx-text="tendenz"></td>
<td class="bg-body-tertiary pt-2" dmx-text="tendenz_chance"></td>
<td class="bg-body-tertiary pt-2" dmx-text="tendenz_risk"></td>
<td class="bg-body-tertiary d-none d-lg-table-cell pt-2" dmx-text="remarks.trunc(50, 'true', '...')"></td>
<td class="bg-body-tertiary pt-2" dmx-text="stoploss"></td>
<td class="bg-body-tertiary pt-2" dmx-text="takeprofit"></td>
<td class="bg-body-tertiary visually-hidden pt-2" dmx-text="assetname_EN"></td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="pagination mt-2" dmx-populate="conn_datacall_paged.data.query" dmx-state="query1" dmx-offset="offset" dmx-generator="bs5paging">
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == 1" aria-label="First">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.first)"><span aria-hidden="true">‹‹</span></a>
</li>
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == 1" aria-label="Previous">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.prev)"><span aria-hidden="true">‹</span></a>
</li>
<li class="page-item" dmx-class:active="title == conn_datacall_paged.data.query.page.current" dmx-class:disabled="!active" dmx-repeat="conn_datacall_paged.data.query.getServerConnectPagination(2,1,'...')">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',(page-1)*conn_datacall_paged.data.query.limit)">{{title}}</a>
</li>
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == conn_datacall_paged.data.query.page.total" aria-label="Next">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.next)"><span aria-hidden="true">›</span></a>
</li>
<li class="page-item" dmx-class:disabled="conn_datacall_paged.data.query.page.current == conn_datacall_paged.data.query.page.total" aria-label="Last">
<a href="javascript:void(0)" class="page-link" dmx-on:click="query1.set('offset',conn_datacall_paged.data.query.page.offset.last)"><span aria-hidden="true">››</span></a>
</li>
</ul>
</div>
</div>
<header class="container-fluid">
<div class="text-black-50 container-fluid">
<div class="row row-cols-5 row-cols-xxl-7">
<div class="col-7 col-xxl">
<nav class="navbar navbar-expand-lg fixed-top">
<a class="navbar-brand style36 fw-light bg-secondary-subtle mt-md-2 ms-md-2 mt-sm-2 ms-sm-2 mt-2 mb-3 ms-2 mb-lg-4 ms-lg-3" href="#">Backend GOAT app</a>
<span class="navbar-text fw-lighter me-2 d-none d-lg-block mb-lg-3">version 1.0.4</span>
<button class="navbar-toggler style71 bg-secondary-subtle" type="button" data-bs-toggle="collapse" data-bs-target="#navbar1_collapse" aria-controls="navbar1_collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end style90" id="navbar1_collapse">
<div class="navbar-nav flex-md-row-reverse flex-md-wrap flex-lg-nowrap flex-lg-row">
<a class="nav-item nav-link active style73 w-50 fw-light text-body bg-secondary-subtle text-center text-md-center align-self-sm-end align-self-end mt-2 ms-2 me-3 pt-3 pb-3 mt-sm-3 me-sm-3 ps-sm-3 mt-md-4 me-md-3 align-self-lg-center mb-lg-3 d-none d-lg-block" dmx-on:click="offcanvas_datacall_paged1.show()">frühere Einträge</a>
<a class="nav-item nav-link active style73 w-50 fw-light text-body bg-secondary-subtle text-center text-md-center align-self-sm-end align-self-end mt-2 ms-2 me-3 pt-3 pb-3 mt-sm-3 me-sm-3 ps-sm-3 mt-md-4 me-md-3 align-self-lg-center mb-lg-3 d-lg-none" dmx-on:click="offcanvas_datacall_paged2.show()">frühere Einträge</a>
<a class="nav-item nav-link style55 text-center fw-light text-body bg-secondary-subtle text-md-center w-50 h-auto align-self-sm-end align-self-end mt-2 ms-2 me-3 pt-3 pb-3 align-self-lg-center pt-lg-4 pb-lg-4 d-none d-lg-block" dmx-on:click="run({run:{outputType:'text',action:`modal2.show()`}})">Logout</a>
<a class="nav-item nav-link style55 text-center fw-light text-body bg-secondary-subtle text-md-center w-50 h-auto align-self-sm-end align-self-end mt-2 ms-2 me-3 pt-3 pb-3 align-self-lg-center pt-lg-4 pb-lg-4 d-lg-none" dmx-on:click="run({run:{outputType:'text',action:`modal2.show()`}})">Logout</a>
</div>
</div>
</nav>
</div>
</div>
</div>
</header>
<div is="dmx-view" id="content" class="style90">
<%- await include(content, locals); %>
</div>
<script src="/bootstrap/5/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
function validateInput(input) {
let commaCount = (input.value.match(/,/g) || []).length; // Count commas
// Check if there is more than one comma
if (commaCount > 1) {
input.setCustomValidity('Bitte geben Sie nur ein Komma ein.');
input.classList.add('is-invalid'); // Apply invalid class
} else {
// Replace the comma with a period for parsing
let value = input.value.replace(',', '.');
let number = parseFloat(value);
// Validate if the number is between 0 and 100
if (!isNaN(number) && number >= 0 && number <= 100) {
input.setCustomValidity(''); // Clear error if valid
input.classList.remove('is-invalid'); // Remove invalid class
input.classList.add('is-valid'); // Optionally add valid class
} else {
input.setCustomValidity('Bitte geben Sie eine Zahl zwischen 0 und 100 ein.');
input.classList.add('is-invalid'); // Apply invalid class
}
}
input.reportValidity(); // Display the error message if any
}
// Attach the input event listener to the input field (e.g., 'tendenz_chance')
document.getElementById('tendenz_chance').oninput = function() {
validateInput(this);
};
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
function validateInput(input) {
let commaCount = (input.value.match(/,/g) || []).length; // Count commas
// Check if there is more than one comma
if (commaCount > 1) {
input.setCustomValidity('Bitte geben Sie nur ein Komma ein.');
input.classList.add('is-invalid'); // Apply invalid class
} else {
// Replace the comma with a period for parsing
let value = input.value.replace(',', '.');
let number = parseFloat(value);
// Validate if the number is between 0 and 100
if (!isNaN(number) && number >= 0 && number <= 100) {
input.setCustomValidity(''); // Clear error if valid
input.classList.remove('is-invalid'); // Remove invalid class
input.classList.add('is-valid'); // Optionally add valid class
} else {
input.setCustomValidity('Bitte geben Sie eine Zahl zwischen 0 und 100 ein.');
input.classList.add('is-invalid'); // Apply invalid class
}
}
input.reportValidity(); // Display the error message if any
}
// Attach the input event listener to the input field (e.g., 'tendenz_chance')
document.getElementById('tendenz_risiko').oninput = function() {
validateInput(this);
};
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
function validateNonNegativeInput(input) {
let commaCount = (input.value.match(/,/g) || []).length; // Count commas
// Check if there is more than one comma
if (commaCount > 1) {
input.setCustomValidity('Bitte geben Sie nur ein Komma ein.');
input.classList.add('is-invalid'); // Apply invalid class
} else {
// Replace the comma with a period for parsing
let value = input.value.replace(',', '.');
let number = parseFloat(value);
// Validate if the input is not a valid number
if (isNaN(number)) {
input.setCustomValidity('Bitte geben Sie eine gĂĽltige Zahl ein.');
input.classList.add('is-invalid'); // Apply invalid class
}
// Validate if the number is negative
else if (number < 0) {
input.setCustomValidity('Bitte geben Sie eine nicht-negative Zahl ein.');
input.classList.add('is-invalid'); // Apply invalid class
} else {
// Clear any custom error if the input is valid
input.setCustomValidity('');
input.classList.remove('is-invalid'); // Remove invalid class
input.classList.add('is-valid'); // Optionally apply valid class
}
}
// Trigger the standard form validation response
input.reportValidity();
}
// Attach the input event listener to the input field (e.g., 'stoploss')
document.getElementById('takeprofit').oninput = function() {
validateNonNegativeInput(this);
};
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
function validateNonNegativeInput(input) {
let commaCount = (input.value.match(/,/g) || []).length; // Count commas
// Check if there is more than one comma
if (commaCount > 1) {
input.setCustomValidity('Bitte geben Sie nur ein Komma ein.');
input.classList.add('is-invalid'); // Apply invalid class
} else {
// Replace the comma with a period for parsing
let value = input.value.replace(',', '.');
let number = parseFloat(value);
// Validate if the input is not a valid number
if (isNaN(number)) {
input.setCustomValidity('Bitte geben Sie eine gĂĽltige Zahl ein.');
input.classList.add('is-invalid'); // Apply invalid class
}
// Validate if the number is negative
else if (number < 0) {
input.setCustomValidity('Bitte geben Sie eine nicht-negative Zahl ein.');
input.classList.add('is-invalid'); // Apply invalid class
} else {
// Clear any custom error if the input is valid
input.setCustomValidity('');
input.classList.remove('is-invalid'); // Remove invalid class
input.classList.add('is-valid'); // Optionally apply valid class
}
}
// Trigger the standard form validation response
input.reportValidity();
}
// Attach the input event listener to the input field (e.g., 'stoploss')
document.getElementById('stoploss').oninput = function() {
validateNonNegativeInput(this);
};
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var form = document.querySelector("janform1"); // Select your form by its ID or class if needed
form.addEventListener("keydown", function (event) {
if (event.key === "Enter") {
event.preventDefault(); // Prevent the form from being submitted
}
});
});
</script>
</body>
</html>
This is for the layout-page.