Modify input validator

- Matched the allowed inputs to what is found in the validator for the
Attribute form (/views/attributes/form.php) for consistency.
- Removed the restriction on colon and added the restriction on
underscore.
- Modified the language line to indicate correct error.
This commit is contained in:
objecttothis committed 2020-07-28 16:58:43 +04:00
1 parent d9ec9ce772
commit 18bdb5d854
3 files changed
+5 -5

No files matched your search

@@ -1,6 +1,6 @@
<?php
<?php
$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'";
$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain '_' or '|'";
$lang["attributes_confirm_delete"] = "Are you sure you want to delete the selected attribute(s)?";
$lang["attributes_confirm_restore"] = "Are you sure you want to restore the selected attribute(s)?";
$lang["attributes_definition_cannot_be_deleted"] = "Could not delete selected attribute(s)";
@@ -1,6 +1,6 @@
<?php
<?php
$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'";
$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain '_' or '|'";
$lang["attributes_confirm_delete"] = "Are you sure you want to delete the selected attribute(s)?";
$lang["attributes_confirm_restore"] = "Are you sure you want to restore the selected attribute(s)?";
$lang["attributes_definition_cannot_be_deleted"] = "Could not delete selected attribute(s)";
+1 -1
View File
@@ -515,7 +515,7 @@ $(document).ready(function()
});
$.validator.addMethod('valid_chars', function(value, element) {
return value.match(/(\||:)/g) == null;
return value.match(/(\||_)/g) == null;
}, "<?php echo $this->lang->line('attributes_attribute_value_invalid_chars'); ?>");
var init_validation = function() {