Description of feature
Description
Currently, when defining or modifying Sample Project Fields, a JavaScript alert popup appears if no field is marked as "Used." This check ensures that at least one field is selected before submitting the form. However, displaying this validation via a popup is not user-friendly and should be replaced with an error message displayed inline within the page.
Steps to Reproduce
- Navigate to the Sample Project Fields section.
- Define or modify fields and ensure none are marked as "Used."
- Attempt to submit the form.
- Observe that a JavaScript alert popup appears warning the user.
Expected Behavior
- The validation message should be displayed inline, near the relevant input fields.
- Users should not receive an intrusive alert popup.
- The form should not submit until at least one field is set to "Used."
Actual Behavior
- A JavaScript
alert() popup appears to notify users about the missing required selection.
Suggested Fix
- Replace the JavaScript
alert() popup with an inline error message in the form.
- Example implementation:
<div class="error-message">At least one field must be marked as "Used." Please update your selection.</div>
- If using JavaScript, update the DOM instead of triggering an alert.
- Use Django messages framework or form validation mechanisms to enforce this check at the backend as well.
Environment
- Django Version: [Add version]
- Python Version: [Add version]
- Affected Page: Sample Project Fields
Additional Context
This update will enhance the user experience and ensure validation messages are more accessible and intuitive.
Description of feature
Description
Currently, when defining or modifying Sample Project Fields, a JavaScript alert popup appears if no field is marked as "Used." This check ensures that at least one field is selected before submitting the form. However, displaying this validation via a popup is not user-friendly and should be replaced with an error message displayed inline within the page.
Steps to Reproduce
Expected Behavior
Actual Behavior
alert()popup appears to notify users about the missing required selection.Suggested Fix
alert()popup with an inline error message in the form.Environment
Additional Context
This update will enhance the user experience and ensure validation messages are more accessible and intuitive.