Initial stab URL validation. Adding '*' to label is now done via CSS :before rather than jquery DOM manipulation.

This commit is contained in:
chouseknecht
2013-09-11 16:44:17 -04:00
parent 39ceceb18e
commit 55292c9d08
4 changed files with 19 additions and 13 deletions

View File

@@ -92,10 +92,9 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
// Prepend an asterisk to required field label
$('.form-control[required]').each(function() {
var label = $(this).parent().parent().find('label');
var rgx = /^\*/;
if ( !rgx.test(label.text()) ) {
// required field does not have leading *
label.prepend('* ');
if (label && !label.hasClass('prepend-asterisk')) {
console.log('adding prepend');
label.addClass('prepend-asterisk');
}
});