Css angepasst. Login/Ausloggen funktionen hinzugefügt.
This commit is contained in:
parent
6b4a600b7f
commit
b01a2fee0a
@ -19,13 +19,13 @@
|
|||||||
<h2>Bestellformular</h2>
|
<h2>Bestellformular</h2>
|
||||||
|
|
||||||
<label for="vorname">Vorname:</label>
|
<label for="vorname">Vorname:</label>
|
||||||
<input type="text" id="Vorname" name="Vorname" required placeholder=" - Vorname -" readonly>
|
<input type="text" id="Vorname" name="Vorname" required placeholder="Vorname">
|
||||||
|
|
||||||
<label for="nachname">Nachname:</label>
|
<label for="nachname">Nachname:</label>
|
||||||
<input type="text" id="Nachname" name="Nachname" required placeholder="- Nachname -" readonly>
|
<input type="text" id="Nachname" name="Nachname" required placeholder="Nachname">
|
||||||
|
|
||||||
<label for="kundenNr">Kunden Nr.:</label>
|
<label for="kundenNr">Kunden Nr.:</label>
|
||||||
<input type="text" id="KundenNr" name="KundenNr" required placeholder="- Kunden Nr. -" readonly>
|
<input type="text" id="KundenNr" name="KundenNr" required placeholder="Kunden Nr.">
|
||||||
|
|
||||||
<label for="strasse">Straße:</label>
|
<label for="strasse">Straße:</label>
|
||||||
<input type="text" id="strasse" name="strasse" required placeholder="Strasse">
|
<input type="text" id="strasse" name="strasse" required placeholder="Strasse">
|
||||||
@ -60,10 +60,23 @@
|
|||||||
const kundenNrInput = document.getElementById('KundenNr');
|
const kundenNrInput = document.getElementById('KundenNr');
|
||||||
const VornameInput = document.getElementById('Vorname');
|
const VornameInput = document.getElementById('Vorname');
|
||||||
const NachnameInput = document.getElementById('Nachname');
|
const NachnameInput = document.getElementById('Nachname');
|
||||||
if (kundenNrInput, VornameInput, NachnameInput) {
|
|
||||||
|
const isLoggedIn = user_id && vorname && nachname;
|
||||||
|
|
||||||
|
if (isLoggedIn) {
|
||||||
kundenNrInput.value = user_id;
|
kundenNrInput.value = user_id;
|
||||||
VornameInput.value = vorname;
|
VornameInput.value = vorname;
|
||||||
NachnameInput.value = nachname;
|
NachnameInput.value = nachname;
|
||||||
|
|
||||||
|
// Felder sperren, damit sie nicht bearbeitet werden können
|
||||||
|
kundenNrInput.readOnly = true;
|
||||||
|
VornameInput.readOnly = true;
|
||||||
|
NachnameInput.readOnly = true;
|
||||||
|
} else {
|
||||||
|
// Felder leer lassen & bearbeitbar
|
||||||
|
kundenNrInput.readOnly = false;
|
||||||
|
VornameInput.readOnly = false;
|
||||||
|
NachnameInput.readOnly = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("User ID from sessionStorage:", user_id);
|
console.log("User ID from sessionStorage:", user_id);
|
||||||
|
|||||||
@ -581,12 +581,6 @@ input[type="text"]:focus, input[type="number"]:focus {
|
|||||||
background-color: #e95b00;
|
background-color: #e95b00;
|
||||||
}
|
}
|
||||||
|
|
||||||
#KundenNr, #Vorname, #Nachname {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
border: none;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.ArtikelNrText, .StueckzahlText {
|
.ArtikelNrText, .StueckzahlText {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user