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

Question

Question

display hidden fields in archived document

asked on September 17, 2014

I am trying to hide certain metadata-type fields (name, email address for example) in the form, but once the document is archived into the repository, I WANT those fields to display on the archived version.

 

I'm using this CSS code to hide them

#q16 {display: none;}
#q17 {display: none;}

Is it possible to hide the fields from the published (public) form,  but pass them through into the archived document?

Other attempts:  I originally used a collapsed section to hide the fields (it's okay if this info is accidentally stumbled upon)  -- but the collapsed section created too much empty space that it made our form require the user to scroll to find the Submit button (our goal is no scrolling to the Submit button). 

When I used CSS to hide the fields, the form displayed perfectly... however, those values are not on the archived document.

[If this just isn't possible... I will then need some help formatting the collapsed fields to remove extra padding/spacing so we can obtain our non-scrolling goal.  Or... is it possible to move the Submit button to appear earlier in the form?]

0 0

Answer

SELECTED ANSWER
replied on September 17, 2014

The easiest way is to have 2 different forms. The first form would have the hidden fields that the end user fills out. The second form would show the fields and be used when saving to the repository. By doing it this way, there is no reason to use additional CSS or JavaScript.

3 0

Replies

replied on September 17, 2014 Show version history

You may be able to hide those fields using Javascript that will check fields on the page, like the following:

 

  1. Set a field that is never going to be Read-Only to have CSS Class ReadMe
  2. Set all the fields you wish to hide from the user to CSS Class DisplayOnArchive
  3. Add the following code into/as your Javascript for that page
$(function() {
  $(document).ready(function () {
    if (!($('.ReadMe').readOnly)) 
     $('.DisplayOnArchive').css('display','none');
  });
});

 

Please note: This solution would require the mandate that Javascript be running in order for this to work. The fields will not be hidden if for instance, Javascript is not running.

1 1
replied on September 17, 2014

Thank you!  I went with creating a copy of the form, removed the hidden CSS commands and changed my Save to LF to use the new form.  In the future, when I have more time to develop javascript skills, I'll give that a whirl.  Thanks again!

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

Sign in to reply to this post.