This sample demonstrates how to utilize client-side API to dynamically display a prompt text
within a text box depending upon the editor's focused state.
Question Comments
Added By: Jacob Blumberg at: 8/26/2013 2:32:41 PM
Change the javascript to this to make the prompt text Gray
function OnTextBoxGotFocus(textBox) {
if (textBox.GetText() == __initialText) {
textBox.SetText("");
textBox.inputElement.style.color = 'black';
}
}
function OnTextBoxLostFocus(textBox) {
if (textBox.GetText() == "") {
textBox.SetText(__initialText);
textBox.inputElement.style.color = 'gray';
}
}
What if you have more than one text box on a page or form, how do you pass separate words for each text box to the function? It needs another parameter or something.
Added By: Alessandro (DevExpress Support) at: 5/6/2014 12:10:03 AM Hi,I have created a separate ticket on your behalf at: ASPxTextBox - Extend E4 (Input prompt in a textbox) to display different prompt text in different text boxes. Please refer to this ticket for further correspondence.