public TextInputGroup(string labelText, string textBoxDescriptionMessage, int sizeInPx = -1, string validFeedback = "", string inValidFeedback = "", bool feedbackAsTooltip = false, bool centeredText = false) { ClassName = "input-group"; Div div1 = new Div { ClassName = "input-group-prepend", Style = { Width = sizeInPx } }; AppendChild(div1); Div div2 = new Div { ClassName = "input-group-text w-100", Text = labelText }; div1.AppendChild(div2); TextInput = new StylableTextInput(); TextInput.SetAttribute("type", "text"); TextInput.ClassName = "form-control" + (centeredText ? " text-center" : ""); TextInput.SetAttribute("placeholder", textBoxDescriptionMessage); TextInput.SetAttribute("aria-label", textBoxDescriptionMessage); TextInput.SetAttribute("aria-describedby", div2.Id); AppendChild(TextInput); ValidationFeedback.AppendValidationFeedbackElements(this, validFeedback, inValidFeedback, feedbackAsTooltip); }
public StylableTextInput AppendTextInput(string textInputGhostMessage, bool centeredText = false, string startText = "") { StylableTextInput textInput = new StylableTextInput(); textInput.SetAttribute("type", "text"); textInput.ClassName = "form-control" + (centeredText ? " text-center" : ""); textInput.SetAttribute("placeholder", textInputGhostMessage); textInput.SetAttribute("aria-label", textInputGhostMessage); textInput.Value = startText; AppendChild(textInput); return(textInput); }