Field Messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2013 07:12 AM
Hi guys,
We are trying to display a message on a field in the incident form (the time_worked field)
I have created a Client script with the following script:
function onLoad() {
g_form.showFieldMsg('time_worked','Please dont forget to fill out your time worked','error');
This works but I wanted to change the message so I adjusted the script.
Instead of changing the message it created a new message on the field on the form (2 messages now)
I checked the wiki and it says to use the following:
g_form.hideFieldMsg('time_worked');
I did this but it only removes the last message not all.
So I checked the wiki again and it says to use the following to clear all messages:
hideFieldMsg(time_worked, [clearAll])
I did this and it clears all but as soon as I disable the client script the message comes back - I have to disable to try to put on the new message!
I have also disabled the original client script I used to create the message but it doesnt remove the message either.
Is there a way to delete this message altogether?
Also, Id like to be able to display a message if the state is not resolved or closed but Id settle for deleting the message first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2013 09:20 AM
"I have also disabled the original client script I used to create the message but it doesnt remove the message either.
Is there a way to delete this message altogether?"
Check other client scripts running on the form that are adding messages. Also check and make sure the script type is an onLoad and NOT an onChange.
Here is the code for more clarity:
g_form.hideFieldMsg('time_worked',1);
g_form.showFieldMsg('time_worked',''Please dont forget to fill out your time worked','error');
hideFieldMsg should go before showFieldMsg in order to only have 1 Msg showing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2013 02:44 PM
Would it help if before showing field message to run:
g_form.hideAllFieldMsgs();
That helped me avoid duplicates -- clear them out before writing.