-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bug fix for phone field #1147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Bug fix for phone field #1147
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,6 @@ | ||||||
| using System; | ||||||
| using System.Collections.Generic; | ||||||
| using System.ComponentModel.DataAnnotations; | ||||||
| using System.Linq; | ||||||
| using System.Text; | ||||||
| using System.Threading.Tasks; | ||||||
|
|
@@ -12,6 +13,9 @@ public class ShippingAddressVm | |||||
|
|
||||||
| public string ContactName { get; set; } | ||||||
|
|
||||||
| [Required(ErrorMessage = "Phone number is required")] | ||||||
| [Phone(ErrorMessage = "Please enter a valid phone number")] | ||||||
| [StringLength(20, MinimumLength = 10, ErrorMessage = "Phone number must be between 10 and 20 characters")] | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| public string Phone { get; set; } | ||||||
|
|
||||||
| public string AddressLine1 { get; set; } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -83,7 +83,8 @@ | |||||||
| <div class="form-group row"> | ||||||||
| <label class="col-sm-4 col-form-label">@Localizer["Phone"]</label> | ||||||||
| <div class="col-sm-8"> | ||||||||
| <input asp-for="NewAddressForm.Phone" type="text" class="form-control"> | ||||||||
| <input asp-for="NewAddressForm.Phone" type="tel"inputmode="numeric" class="form-control" | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phone can support formats like this |
||||||||
| oninput="this.value = this.value.split('').filter(function(c){return c >= '0' && c <= '9';}).join('');"> | ||||||||
|
Comment on lines
+86
to
+87
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| </div> | ||||||||
| </div> | ||||||||
| </div> | ||||||||
|
|
@@ -174,7 +175,8 @@ | |||||||
| <div class="form-group row"> | ||||||||
| <label class="col-sm-4 col-form-label">@Localizer["Phone"]</label> | ||||||||
| <div class="col-sm-8"> | ||||||||
| <input asp-for="NewBillingAddressForm.Phone" type="text" class="form-control"> | ||||||||
| <input asp-for="NewBillingAddressForm.Phone" type="tel" inputmode="numeric" class="form-control" | ||||||||
| oninput="this.value = this.value.split('').filter(function(c){return c >= '0' && c <= '9';}).join('');"> | ||||||||
|
Comment on lines
+178
to
+179
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| </div> | ||||||||
| </div> | ||||||||
| </div> | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 20 chars?