Regex that works for the first character entered
This commit is contained in:
parent
d816c00a59
commit
327d8ea94d
4
resources/assets/js/views/common/items.js
vendored
4
resources/assets/js/views/common/items.js
vendored
@ -34,9 +34,11 @@ const app = new Vue({
|
||||
|
||||
watch: {
|
||||
'form.sale_price': function (newVal, oldVal) {
|
||||
if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') == -1) {
|
||||
if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') === -1) {
|
||||
if(newVal.search('(?<!.).(?!.)') === -1){
|
||||
this.form.sale_price = oldVal;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'form.purchase_price': function (newVal, oldVal) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user