Show CSS Attribute when listvariable is true (Javascript)

  • 27 August 2021
  • 7 replies


i would change CSS Attributes or SHOW/HIDE a html line via Javascript.


In that case:

I have a RichTextField in NintexForms (i need this in a richtextfield) , html like:


<div class="HEIDI">Hide this</div>


<span class="JAVASCRIPTID">Hide this</span>



CSS in Nintex Forms if CSS is neccessary:


display: block;


So if my list variable "LIST_blocki" is true the html should be blocked like display: none;


I´m pretty sure i need Javascript for this and I want realise this with a Javascript ID in the html field. So i should work with a <span class="JAVASCRIPTID"> ?


Can some one explain how this gonna work ?

Huge thanks!

7 replies

Userlevel 5
Badge +14

Could you please provide a few screenshots to help us picture what is you're working with? Is it Classic Forms or Responsive? Does the ENTIRE RichTextField Control need to be hidden or just he html inside of it? 

Hey thanks for the response,

I can´t do a screenshot right now because the pc I work on is lil bit far away BUT ...


Just a part of the html inside the RichText Field have to be hidden not the whole field.


So when i could give another example:



In which language you want me to talk ?


English!<span class="JAVASCRIPTID">But please talk slowly!</span>



If LIST VARIABLE "HelpLanguage" is 0 then hide JAVASCRIPTID


Case if LIST VARIABLE "HelpLanguage" is 0

In which language you want me to talk ?



Case if LIST VARIABLE "HelpLanguage" is 1

In which language you want me to talk ?

English! But please talk slowly!

Userlevel 5
Badge +14

just following up, is this Responsive or Classic form? 

also maybe you can get a screenshot now? 

Hi it´s in the classic form.
I just want hide or view a specific javascript ID which is declared in the richfield html(code) ...



Can´t make Screenshots, its to sensitive, so it´s deactivated on my computer 😞.


Userlevel 5
Badge +14



is the List column "HelpLanguage" set on the form in question or is it just a value that gets set elsewhere (directly on the list item or otherwise)? If it's set on the form what type of control are we working with? Choice Drop Down, or something else? 

Hey MegaJerk,

the "HelpLanguage" is a variable that is already filled in the Workflow, so when i view the element the variable HelpLanguage is already filled as 0 or 1.

The Javascript just ask the HelpLanguage variable if it´s 0 or 1, if it´s 1 then view Javscript ID "JAVASCRIPTID007"

if 0 then dont show the html code.


I just want to show the SPAN when a listvariable like "HelpLanguage" are true (1).




In which language you want me to talk ?


English!<span class="JAVASCRIPTID007">But please talk slowly!</span>



Hey, as alternative ... could you help me with that ?