Initially hidden form field

dmartinc
Tera Expert

Hello all (specially SNow devs),

Is there a way to have form field "really" initially hidden?
We have added many custom fields to our incident form. Most of the time, they are hidden (thanks to UI Policies).
However when the page loads, on slow computers / browsers (mainly IE) one can see these fields during a moment (sometimes a long moment) before the UI Policies kick in and hide the field. This is both confusing for the users and adds page load time.

So... is there a way to have a form field initially hidden? By "initially" I mean in the HTML that is sent from server to client, via a style="display:none;" or similar, before the client scripts / policies act.
If not, are there any plans of adding this feature later, maybe as a new dictionary field or attribute?

Note: if you remove a field from the form completely, you cannot show it later with a UI Policy.

Thanks in advance,
David

8 REPLIES 8

I'm not even sure that it's technically possible to avoid completely in a browser app...which is why I created the solution I did. You can open an enhancement request with ServiceNow support if you want though.


John Caruso
Kilo Guru

Yes it is possible. The OP mentioned it: style="display:none;" - or a CSS class that sets that style.

I'm currently evaluating SN so I don't have a support account, or else I would request an enhancement. This would be a very easy thing to do.


Hello Mark, John,

First of all thanks again to Mark for his suggested solution. It took 10 min to implement in one of our forms. Now I just have to decide which forms / views to include the formatter(s).

Second, to John: your comment somehow made my brain connect a few ideas I've been having lately and I found a way of achieving this... although just a start. I will post details if I finish it.

Just a hint: it involves using formatters, and either CSS and a couple of really mean hacks, or Javascript (although this I would prefer to avoid).

Cheers,
David


John Caruso
Kilo Guru

David,

Great to hear! I'll have to look into formatters...

I'm a total newbie on the ServiceNow platform, but have a long history of web development with skills in JavaScript, jQuery, CSS, HTML, ASP.NET, C#, etc.

I'm definitely looking forward to mastering the SN platform and collaborating with the community.

John