I need Asterisk symbol to indicate a required input near form control label and make popup alert for mandatory field if it is not filled up
<div class="form-group form-group">
<label for="status" class="col-sm-2 control-label">
<spring:message code="labels.status"/>
</label>
<div class="col-sm-9">
<input id="picture" class="form-control" type="text" value="${form.status}" name="status"
autofocus/>
<form:errors path="status" style="color:red;"></form:errors>
</div>
</div>
Added below code in css file.
.required:after {
content:" *";
color: red;
}
Added required in label class.
<label for="status" class="col-sm-2 control-label required ">
<spring:message code="labels.status"/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.