Search box with light textMay 20, 2013 at 10:37 am | Posted in Oracle Developement | 5 Comments
You can often find search boxes that are pre-populated with text in a a light-weight font. When you click the box, the text disappears to make room for your search terms. The text you then type then shows in a normal-weight font.
Here are the steps to do this in Apex:
- Create a text field for your search box (P11_SEARCH in my example).
- Set the default value to “Enter Search Terms”.
- Set the HTML Form Element Attributes to: style=”font-weight:100″
- You may also want to change the Source Used attribute to “Always, replacing any existing value in session state”
This pre-populates the text box with light weight text.
Now we need a dynamic action with two TRUE actions: One to clear out the text box when it is clicked, the other to set the font-weight to normal.
Create a dynamic action “Clear Search Box”:
Make sure the DA has the condition to only fire when the current value is the default value of the text box.
Set the first TRUE action to Clear the text box,
and choose the text field as the affected item.
Add a second TRUE action to set the font-weight to normal:
When you now click the text field, the pre-populated text clears out, and you can type in a search term in normal font weight.
See the example here.
Please leave a comment if you found this useful.