- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 09:34 AM
Hello Community,
Please how to I add a ghost texts to a place holder? I will like to add some ghost texts to a text box as a form of additional information that will disappear once the user starts to type into the text box.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 10:07 AM
Which table form do you want this placeholder text to appear in? Write an onLoad Client script for that table and the script is:
function onLoad() {
u_addPlaceholderAttribute('u_client', 'Testing placeholder \r\n new line \r\n 3rd line \r\n 4th \r\n this is last');
}
Then write a UI script (because this can be used again anywhere) that goes like this:
function u_addPlaceholderAttribute(variableName, hint) {
try{
var fieldName = g_form.getControl(variableName).name.toString();
if (Prototype.Browser.IE) {
fieldName.placeholder = hint;
} else {
$(fieldName).writeAttribute('placeholder', hint);
}
} catch(err) {}
}
The function call (u_addPlaceholderAttribute) in the onLoad client script should be the function name (u_addPlaceholderAttribute) you give in the UI script. Is this what you did? In my example, 'u_client' is the name of the field where I wanted my placeholder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 09:14 PM
Hello,
I've been trying to set a placeholder text on CHG table, test plan field in workspace view.
Unfortunately, it is not working with the above onLoad Client script and UI script.
Please assist!