Skip to content

Commit

Permalink
feat: add warning to save
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Arce <[email protected]>
  • Loading branch information
raphael-arce committed Oct 21, 2024
1 parent f2395cb commit 5eff763
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ main {
}

button {
margin-top: 2rem;
margin-top: 1rem;
width: 200px;
background-color: #121212;
color: white;
Expand Down Expand Up @@ -99,3 +99,12 @@ form {
.group-c {
width: 280px;
}

.warning {
border: 2px solid;
padding: 0.5rem;
background-color: #f4a203;
margin-top: 1rem;
margin-left: auto;
margin-right: auto;
}
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ <h3 class="medium">Würfel C: Medium</h3>
</div>
</div>
</div>

<div class="warning">⚠️Warnung: Speichern verursacht Kosten ⚠️</div>
<button type="submit">Speichern</button>
</form>
</main>
Expand Down Expand Up @@ -216,6 +218,13 @@ <h3 class="medium">Würfel C: Medium</h3>
</body>
<script type="text/javascript">
function onSubmit(event) {
const confirmationText = `Speichern verursacht kosten. Sind Sie sich sicher, diese Änderungen speichern zu wollen?`;

if (confirm(confirmationText) === false) {
event.preventDefault();
return;
}

event.preventDefault();

const labels = {};
Expand Down

0 comments on commit 5eff763

Please sign in to comment.