|
|
@@ -1214,6 +1214,8 @@ function buildSettings($array) {
|
|
|
<script>
|
|
|
$(document).ready(function() {
|
|
|
$(\'#'.$pageID.'_form\').find(\'input, select, textarea\').on(\'change\', function() { $(this).attr(\'data-changed\', \'true\'); });
|
|
|
+ var '.$pageID.'Validate = function() { if (this.value && !RegExp(\'^\'+this.pattern+\'$\').test(this.value)) { $(this).addClass(\'invalid\'); } else { $(this).removeClass(\'invalid\'); } };
|
|
|
+ $(\'#'.$pageID.'_form\').find(\'input[pattern]\').each('.$pageID.'Validate).on(\'keyup\', '.$pageID.'Validate);
|
|
|
$(\'#'.$pageID.'_form\').find(\'select[multiple]\').on(\'click\', function() { $(this).attr(\'data-changed\', \'true\'); });
|
|
|
|
|
|
$(\'#'.$pageID.'_form\').submit(function () {
|