Skip to main content
Nintex Community Menu Bar

Show CSS Attribute when listvariable is true (Javascript)

  • Aug 27, 2021 12:12 PM UTC
  • 7 replies
  • 41 views
  • Translate All

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
  • Aug 27, 2021 2:06 PM UTC

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? 

Translate

  • Author
  • Aug 27, 2021 8:25 PM UTC

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!

Translate

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • Sep 7, 2021 2:03 PM UTC

just following up, is this Responsive or Classic form? 

also maybe you can get a screenshot now? 

Translate

  • Author
  • Sep 30, 2021 10:42 AM UTC

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

 

Translate

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • Sep 30, 2021 1:38 PM UTC

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? 

Translate

  • Author
  • Oct 4, 2021 9:28 AM UTC

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>

 

Translate

  • Author
  • Nov 15, 2021 1:53 PM UTC