Merge pull request from GHSA-625g-fm5w-w7w4
* fix possibility to have empty name/surname and empty company Signed-off-by: Michael Kaufmann <d00p@froxlor.org> * let js validation for customer add/edit form also trim() entered data to avoid empty values pass the client-side validation Signed-off-by: Michael Kaufmann <d00p@froxlor.org> --------- Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -8,18 +8,18 @@ export default function () {
|
||||
rules: {
|
||||
'name': {
|
||||
required: function () {
|
||||
return $('#company').val().length === 0 || $('#firstname').val().length > 0;
|
||||
return $('#company').val().trim().length === 0 || $('#firstname').val().trim().length > 0;
|
||||
}
|
||||
},
|
||||
'firstname': {
|
||||
required: function () {
|
||||
return $('#company').val().length === 0 || $('#name').val().length > 0;
|
||||
return $('#company').val().trim().length === 0 || $('#name').val().trim().length > 0;
|
||||
}
|
||||
},
|
||||
'company': {
|
||||
required: function () {
|
||||
return $('#name').val().length === 0
|
||||
&& $('#firstname').val().length === 0;
|
||||
return $('#name').val().trim().length === 0
|
||||
&& $('#firstname').val().trim().length === 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user