Hi,
Yes, you can do it through style sheet.
Here is the logic you can try:
var selObject = get the select control.
if(value is blank or empty) {
selObject.removeStyleClass("selectNormalValueState");
selObject.addStyleClass("selectErrorValueState");
} else {
selObject.removeStyleClass("selectErrorValueState");
selObject.addStyleClass("selectNormalValueState");
}
Below is CSS:
.selectErrorValueState{
border-width: 2px;
border-style: Solid;
border-color: #CC0000;
background-color: #FFDDD9;
padding: 0 0.6875rem;
}
.selectNormalValueState{
color: #000000;
background-color: #ffffff;
border: 1px solid #c0c0c0;
}
Hope this might help.
Thanks,
Dheeram