Hi All,
I have an entry form where some fields are mandatory so displaying asterix sign there(*).
Now I have a requirement to change Font-color of all the fields marked with asterix to RED Color. I have a code block where I am displaying asterix if the field is required. I am not getting how to modify it to change the font-color to RED. Below is the code:-
public static DoubleDiv BeginControlGroupForWorkType(this HtmlHelper htmlHelper, string controlId, string label, bool isRequired, WorkEffort workEffort)
{
string validationHTML = GetValidationMessage(htmlHelper, controlId, label, Enums.WorkEffortTab.None);
if (string.IsNullOrEmpty(validationHTML))
validationHTML = GetValidationMessageForWorkType(htmlHelper, controlId, workEffort);
htmlHelper.ViewContext.Writer.Write(string.Format(@"
<div class=""control-group"">
{0}
<label class=""control-label"" for=""{1}"">{2} {3}</label>
<div class=""controls"">",
validationHTML,
controlId,
isRequired ? "">*" : string.Empty,
label));
return new DoubleDiv(htmlHelper.ViewContext);
}
Can anybody please help me in this.
Thanks
Fozia
What I have tried:
I am trying to modify the existing Required class but it is not impacting the label. I also tried putting isRequired line again but how to modify the existing label with that condition, because label is already created above that isRequired condition.