Textbox hint in ZK - textbox

I want to have a textbox with a hint. For example, if that textbox triggers a search, I want it to initially have a "Search" text greyed out and when the user starts typing for it to disappear. How do I achieve this in ZK?
In android I think I had the hint tag, so I want something similar to that.

Okay, so I found it's called placeholder.

Related

GTK Clickable Text inside Text View/Buffer

How to make a portion of text inside a GTKTextView to be clickable, so that clicking on the specified portion will trigger some event? And, moreover, how to obtain the exact portion of the text being clicked in the event that is triggered?
Ok, I see that GtkGestures should be used to manage this sort of stuff now in GTK4. Sorry for wasting anybody's time of reading this question.

Suggestions dropdown for Vaadin TextField

How can we add like say google email search, a down arrow icon or even just the function of the down arrow to the Text Field?
The issue is in this component is, It shows suggestion when I start typing. I need to show all suggestions on focus or a down arrow, when I click down arrow it will show all the suggestions. Any help would be appreciated.

data-placeholder and jQueryUI autocomplete

Is there a simple way to have a default text in the textbox using jQueryUI's autocomplete ?
I have tried using data-placeholder but it doesn't seem to work.
I have searched online, and people suggest using the textbox value to display the text, and clear it on focus. But then I would need to change the font style just for the default text, and check onKeyUp when the text is manually erased etc...
Is there no easier way to do this ? or am I missing something ?
A lot of people will use a span that is positioned to be over the text box. When the text box gets focus then you hide the span. When the text box blurs and has a value, you don't show it. If it doesn't have a value then you can show it again.
You can style the span however you want independently of the text box so you would not have to change the font style on the text box itself. You would have to subscribe to the focus and blur events, but it would be much easier if you created a jQuery plugin to do this. In fact, I'm sure there are ones that already exist that do this.

Button on jQuery UI

I am writing a script using jQueryUI's button http://jqueryui.com/dialog/#modal-form.
The button is pretty fancy looking.
Now, when I tried to use jQuery to change the display name of the button:
$('#signin').text("new name");
The Button revert to the original style of the browser, with no padding and etc. I don't know why change of style happens when I just change the display name of the button. Please suggest me a way to fix it.
To change button text use this :
$('#btnId').val('new-text');
I figured out how. I used a span tag around the display name and just change text of that span tag.

read-only Textbox

The form window(chat window) that i am creating for a lan messenger is similar to the one in google talk with two textboxes. What i need to do is to transfer characters typed in the lower textbox(textbox2) to the upper textbox(textbox1 which is read-only) when i click the submit button without showing that textbox1 is read-only because the characters are appearing in grey.please help with code if possible.
Use a label for this instead of a textbox. If the only thing it is doing is display the characters and not a direct edit, you won't lose any functionality and the text would not be greyed out...
If you're going to use a Texbox, set it to Locked. That shouldn't gray the characters out. Otherwise in KeyDown/KeyUp events, set the e.Handled property to true (which will tell the box that you want to handle the input yourself and don't want the message to filter down).
That oughta do it for you.

Resources