Skip to content

Commit

Permalink
fixed isdisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
acmoune committed Jun 5, 2024
1 parent 3189465 commit 00b0f74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/OsanWebsite.Web/Components/BookingForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
<div class="form-container container" style="padding:10px;">
<p>
<label>Date</label>
<InputDate @bind-Value=_booking.BookingDate class="form-control" style="font-size: 12pt;" />
<InputDate @bind-Value=_booking.BookingDate class="form-control" style="font-size: 12pt;" disabled="@isEventBased()" />
<ValidationMessage For=@(() => _booking.BookingDate) />
</p>

<p>
<label>Service</label>
<InputSelect @bind-Value=_booking.Service class="form-control" style="font-size: 12pt;">
<InputSelect @bind-Value=_booking.Service class="form-control" style="font-size: 12pt;" disabled="@isEventBased()">
<option value="">-- Selectionnez un service --</option>
@foreach (var s in _services)
{
Expand Down Expand Up @@ -131,6 +131,8 @@
StateHasChanged();
}

private bool isEventBased() => EventSlug != null && CampaignId != null;

private async void onSubmit()
{
if (form.EditContext!.Validate())
Expand Down

0 comments on commit 00b0f74

Please sign in to comment.