mirror of
https://github.com/tmdinosaurcenter/kiosk-guestbook.git
synced 2025-09-13 02:53:33 -06:00
Add server-side input validation
- Validate that first_name, last_name, email, and location are provided - Add regex-based email format validation in app.py - Display error messages on the guestbook form if validation fails These changes help ensure that only properly formatted data is stored.
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
|
||||
<body>
|
||||
<h1>Museum Visitor Guestbook</h1>
|
||||
{% if error %}
|
||||
<div style="color: red;">{{ error }}</div>
|
||||
{% endif %}
|
||||
<form method="post" action="/">
|
||||
<label for="first_name">First Name(s):</label><br>
|
||||
<input type="text" id="first_name" name="first_name" required><br><br>
|
||||
|
Reference in New Issue
Block a user