In one of my JS scripts I call on frontend
MyExtension.submitbutton = function(task) {
if(task == 'emgroup.cancel' || document.formvalidator.isValid('#item-form')) {
Emerald.submitform(task, document.getElementById('item-form'));
} else {
alert('Invalid form');
}
}
Pay attention to document.formvalidator.isValid
So I get this
The problem is in validate.js
add to your page
<script>
function submit_test() {
if(document.formvalidator.isValid('#item-form')) {
console.log('Ok');
}
}
</script>
<form method="post" name="adminForm" id="item-form" class="form-validate form-horizontal">
<button type="button" class="btn-submit btn btn-primary" onclick="submit_test();">Apply</button>
<input type="text" name="jform[name]" id="jform_name" value="" required>
</form>
Console log print OK
Error
Windows 7 SP1
Latest Chrome
No
Labels |
Added:
?
|
Category | ⇒ | JavaScript |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-04-11 16:13:37 |
Closed_By | ⇒ | Serhioromano |
Looks like I can fix it by changing
to
You can close this issue.