Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

Input prompt in a textbox

$
0
0

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';
            }
            
        }

Added By: Douglas Poston 1 at: 5/5/2014 9:55:21 AM    

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.

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>