M
Matheus

Padel Game Result Registration

Bootstrap Padel Result Form records team player names, match date, location and per-set scores. Uses EditForm validation (DataAnnotations) and Bootstrap layout with cards and grid.

LIVE DEMO
Generated using Instruct UI - An AI for Blazor UI Generation
## What's implemented - Team entry cards for Team A and Team B with player name fields. - Match details: match date and location inputs. - Per-set score inputs using InputNumber for multiple sets. - Form validation with DataAnnotations and visible ValidationMessage components. - Submission flow with success alert after valid submit. ## Key components - EditForm, DataAnnotationsValidator, ValidationMessage - InputText, InputDate, InputNumber - Bootstrap form elements and layout: container, row, col-*, card, btn, input-group - PadelResultModel and SetResultModel with [Required], [StringLength], [Range] ## How it works - A PadelResultModel instance is bound to the EditForm via Model and @bind-Value on inputs. - Validation uses DataAnnotationsValidator and individual ValidationMessage components to display model errors. - OnValidSubmit triggers HandleValidSubmit which sets a local flag (formSubmitted) to show a success alert. - Sets are represented as a List<SetResultModel> and rendered with a for loop using index-based @bind-Value to each Set element. ## Styling - Layout and spacing rely on Bootstrap classes (container, row, col-md-*, card, btn, input-group, form-control). - Icons use FontAwesome classes (fa-*) in labels and headings; include FontAwesome CSS when integrating. - The structure is responsive via Bootstrap grid; cards stack on small screens and display two-column layout on md+. ## Reuse steps 1. Add a Blazor page and the PadelResultModel/SetResultModel classes to the project. 2. Ensure Bootstrap and FontAwesome CSS are included (wwwroot or _Host/_Layout). No extra NuGet required for core Blazor inputs. 3. Import System.ComponentModel.DataAnnotations in models and the page for validation attributes. 4. Place the Razor markup inside Pages and update routes; verify EditForm, InputText, InputDate, InputNumber bindings. 5. Wire a persistence service in Program.cs or inject a repository/DbContext and replace Console.WriteLine in HandleValidSubmit with a save call. ## Limitations & next steps - This is a single-page UI generated by Instruct UI; it lacks persistence, authentication, and server-side saving. - Error handling and UX enhancements (client-side validation summaries, toast notifications, form reset or redirect) require additional code. - Consider adding dynamic set count, validation for match winner logic, and integration with a backend API or EF Core DbContext. - Ensure localization and date handling for different cultures if needed. - Generated by Instruct UI and intended as editable starter code for .NET projects.