$('input').each(function(){
if($(this).is('[required=required]')){
if ($(this).is('[noAsterisk]')){
return null;
} else {
$(this).closest(".YourClassName").children("label").append('<font style="color:red;position:absolute;" > *</font>');
}
}
});
* javascript above require jQuerywith the code:
if ($(this).is('[noAsterisk]')){allow you to add exception with 'noAsterisk', where you don't require asterisk as there had 'required' html tag appended.
return null;
}
No comments:
Post a Comment
Hey, thank you for spending time leaving some thoughts, that would be really helpful as encouragement for us to write more quality articles! Thank you!