Follow up - 45f56b0d7c
- Fixed missing html 5 checks for generic create and edit dialogs.
This commit is contained in:
parent
45f56b0d7c
commit
dd2bc1eca8
1 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,11 @@ class App.ControllerGenericNew extends App.ControllerModal
|
||||||
object = new App[ @genericObject ]
|
object = new App[ @genericObject ]
|
||||||
object.load(params)
|
object.load(params)
|
||||||
|
|
||||||
|
# validate form using HTML5 validity check
|
||||||
|
element = $(e.target).closest('form').get(0)
|
||||||
|
if element && element.reportValidity && !element.reportValidity()
|
||||||
|
return false
|
||||||
|
|
||||||
# validate
|
# validate
|
||||||
errors = object.validate()
|
errors = object.validate()
|
||||||
if errors
|
if errors
|
||||||
|
@ -70,6 +75,11 @@ class App.ControllerGenericEdit extends App.ControllerModal
|
||||||
params = @formParam(e.target)
|
params = @formParam(e.target)
|
||||||
@item.load(params)
|
@item.load(params)
|
||||||
|
|
||||||
|
# validate form using HTML5 validity check
|
||||||
|
element = $(e.target).closest('form').get(0)
|
||||||
|
if element && element.reportValidity && !element.reportValidity()
|
||||||
|
return false
|
||||||
|
|
||||||
# validate
|
# validate
|
||||||
errors = @item.validate()
|
errors = @item.validate()
|
||||||
if errors
|
if errors
|
||||||
|
|
Loading…
Reference in a new issue