You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/05-checkout-with-validation.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,12 +42,12 @@ As usual, you'll need to `@inject` values for `OrderState`, `HttpClient`, and `N
42
42
Next, let's bring customers here when they try to submit orders. Back in `Index.razor`, make sure you've deleted the `PlaceOrder` method, and then change the order submission button into a regular HTML link to the `/checkout` URL, i.e.:
Note that we removed the `disabled` attribute, since HTML links do not support it, and added appropriate styling instead.
50
+
> Note that we removed the `disabled` attribute, since HTML links do not support it, and added appropriate styling instead.
51
51
52
52
Now, when you run the app, you should be able to reach the checkout page by clicking the *Order* button, and from there you can click *Place order* to confirm it.
53
53
@@ -193,7 +193,7 @@ namespace BlazingPizza
193
193
}
194
194
```
195
195
196
-
Now, recompile and run your application, and you should be able to observe the validation rules being enforced on the server. If you try to submit an order with a blank delivery address, then the server will reject the request and you'll see an HTTP 400 ("Bad Request") error in the browser's *Network* tab:
196
+
Now, after you recompile and run your application, you should be able to observe the validation rules being enforced on the server. If you try to submit an order with a blank delivery address, then the server will reject the request and you'll see an HTTP 400 ("Bad Request") error in the browser's *Network* tab:
@@ -248,7 +248,7 @@ Next, instead of triggering `PlaceOrder` directly from the button, you need to t
248
248
249
249
As you can probably guess, the `<button>` no longer triggers `PlaceOrder` directly. Instead, the button just asks the form to be submitted. And then the form decides whether or not it's valid, and if it is, *then* it will call `PlaceOrder`.
250
250
251
-
Try it out: you should no longer be able to submit an invalid form, and you'll see validation messages (albeit unattractive ones).
251
+
Try it out: you should no longer be able to submit an invalid form, and you'll see validation messages (albeit unattractive ones) where you placed the `ValidationSummary`.
0 commit comments