Skip to main content
Nintex Community Menu Bar

Show CSS Attribute when listvariable is true (Javascript)

  • August 27, 2021
  • 7 replies
  • 16 views

Hey,

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>

or

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

 

 

CSS in Nintex Forms if CSS is neccessary:

 

.HEIDI {
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

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • August 27, 2021

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? 


  • Author
  • August 27, 2021

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:

 

<body>

In which language you want me to talk ?

<br>

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

</body>

 

If LIST VARIABLE "HelpLanguage" is 0 then hide JAVASCRIPTID

 

Case if LIST VARIABLE "HelpLanguage" is 0

In which language you want me to talk ?

English!

 

Case if LIST VARIABLE "HelpLanguage" is 1

In which language you want me to talk ?

English! But please talk slowly!


MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • September 7, 2021

just following up, is this Responsive or Classic form? 

also maybe you can get a screenshot now? 


  • Author
  • September 30, 2021

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 :(.

 


MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • September 30, 2021

Alrighty.

 

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? 


  • Author
  • October 4, 2021

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).

 

 

<body>

In which language you want me to talk ?

<br>

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

</body>

 


  • Author
  • November 15, 2021