diff --git a/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt b/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt new file mode 100644 index 000000000..2de67ce95 --- /dev/null +++ b/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt @@ -0,0 +1,20 @@ + + + + + + {% if type == "text" %} + + {% elseif type == "checkbox" %} + + {% endif %} + + {% if help|default(false) %} +
+ {{help}} + {% endif %} + + + + + \ No newline at end of file diff --git a/src/opnsense/www/js/opnsense.js b/src/opnsense/www/js/opnsense.js index c59684301..435b43e0e 100644 --- a/src/opnsense/www/js/opnsense.js +++ b/src/opnsense/www/js/opnsense.js @@ -80,10 +80,13 @@ function setFormData(parent,data) { function handleFormValidation(parent,validationErrors) { $( "#"+parent+" input" ).each(function( index ) { if (validationErrors != undefined && $(this).attr('id') in validationErrors) { - $(this).parent().addClass("has-error"); + //$(this).parent().addClass("has-error"); + $("*[for='" + $(this).attr('id') + "']").addClass("has-error"); + //$(this).addClass("has-error"); $("span[for='" + $(this).attr('id') + "']").text(validationErrors[$(this).attr('id')]); } else { - $(this).parent().removeClass("has-error"); + $("*[for='" + $(this).attr('id') + "']").removeClass("has-error"); + //$(this).removeClass("has-error"); $("span[for='" + $(this).attr('id') + "']").text(""); } });