You are viewing limited content. For full access, please sign in.

Question

Question

Conditionally hide cf-helptext

asked on May 10, 2017

I have a simple two step process that is just a form that gets filled out and emailed.  Most of the fields in the form have "text below field" filled out with some help text for the field.  The help text is irrelevant to the person receiving the emailed form and clutters up the view of the info.  I would like the text to be visible to the person filling out the form but want it hidden on the emailed PDF.  The classes on the labels are "cf-helptext un-help".  Any ideas on how I can accomplish this?

A further question that isn't as important, is it possible to hide all fields in the emailed PDF that haven't been filled out by the submitter?

Thanks.

0 0

Replies

replied on May 10, 2017

Found my own answer.  I thought I'd include it in case it helps anyone else.

Basically I set up the form to retrieve the current step ID token as per instructions in this post.  Then I used the a function (injectStyles) to inject a style into the body of the page (as per this post) when it was not the first step of the process.

  //inject CSS rule at the bottom of the page
  function injectStyles(rule) {
    var div = $("<div />", {
      html: '&shy;<style>' + rule + '</style>'
    }).appendTo("body");    
  }

  
  //hide the helptext when it's not the first step
  //i.e. hide it for the emailed PDF of step 2
  if ($('.currentStepID').text() != '1') {
    injectStyles('.cf-helptext {display:none; }');
  	}

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.