Make FormValidator.CheckValidDate method public
This commit is contained in:
parent
5c15b9de20
commit
c2d8006748
|
@ -270,7 +270,7 @@ func (form *contactForm) Validate(ctx context.Context, conn *Conn) bool {
|
||||||
validator.CheckValidEmailInput(form.Email, gettext("This value is not a valid email. It should be like name@domain.com.", form.locale))
|
validator.CheckValidEmailInput(form.Email, gettext("This value is not a valid email. It should be like name@domain.com.", form.locale))
|
||||||
}
|
}
|
||||||
if form.Web.Val != "" {
|
if form.Web.Val != "" {
|
||||||
validator.checkValidURL(form.Web, gettext("This value is not a valid web address. It should be like https://domain.com/.", form.locale))
|
validator.CheckValidURL(form.Web, gettext("This value is not a valid web address. It should be like https://domain.com/.", form.locale))
|
||||||
}
|
}
|
||||||
validator.CheckRequiredInput(form.Address, gettext("Address can not be empty.", form.locale))
|
validator.CheckRequiredInput(form.Address, gettext("Address can not be empty.", form.locale))
|
||||||
validator.CheckRequiredInput(form.City, gettext("City can not be empty.", form.locale))
|
validator.CheckRequiredInput(form.City, gettext("City can not be empty.", form.locale))
|
||||||
|
|
|
@ -180,7 +180,7 @@ func (v *FormValidator) CheckValidSelectOption(field *SelectField, message strin
|
||||||
return v.checkSelect(field, field.HasValidOptions(), message)
|
return v.checkSelect(field, field.HasValidOptions(), message)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *FormValidator) checkValidURL(field *InputField, message string) bool {
|
func (v *FormValidator) CheckValidURL(field *InputField, message string) bool {
|
||||||
_, err := url.ParseRequestURI(field.Val)
|
_, err := url.ParseRequestURI(field.Val)
|
||||||
return v.checkInput(field, err == nil, message)
|
return v.checkInput(field, err == nil, message)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue