- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 12:03 AM
i am creating the filed , with name comment and data type is string. and than i added default value as please add comment. when user click on the field the default value need to erase . how can i achive that.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 01:26 AM - edited 06-21-2025 01:27 AM
@vits18735a0 Did you give the script above a try? It works the same way—the placeholder shows only when the field is empty. Once the user types something or clicks into the box, the placeholder disappears automatically.
Don't use the default value here...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 01:41 AM
@vits18735a0You can use a single client script to add placeholders to multiple fields—there’s no need to create separate scripts for each one.
Sample:
function onLoad() {
var placeholder_1 = g_form.getControl('field_1');
if (placeholder_1) {
placeholder_1.placeholder = 'Enter your text here';
}
var placeholder_2 = g_form.getControl('field_2');
if (placeholder_2) {
placeholder_2.placeholder = 'Enter your text here';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 12:24 AM
HI @vits18735a0
Create one OnLoad client script like below to add a placeholder value.
function onLoad() {
var ctrl = g_form.getControl('u_comments'); //CHANGE THE FIELD NAME AS REQUIRED
if (ctrl) {
ctrl.placeholder = 'Enter your text here';
}
}
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 01:06 AM
Hi j siva,
Thanksd for the replay, now i understand that we are able to show the default msg in the field.
but what if we alreday have the default for the field , so is it also remove like the onload functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 01:16 AM
@vits18735a0 The default value is different from the placeholder. If a default value is configured for the field, it will be displayed instead of the placeholder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2025 01:20 AM
Are we able to remove the place holder , like we did for placeholder?
expected : once user click on the field than default msg need to remove.