Hidden fields in a lotus form open with a browser

In a lotus form you can hide the fields enabling the check box “Hide paragraph from Web browser” in the window of the properties of the field but in this way the field is not generated as a hidden field, i.e. a html tag input with attribute type=”hidden” is not generated and you can’t access to its value from a browser, for example using javascript.
This is a different behavior from that one using a lotus client where you can still access to the hidden fields using lotusscript and formula language.
You can verify creating a lotus form with a field called “MyHiddenField” of type Text and Editable wit default value “I am a hidden field” and with properties
hidden field properties
and add a button of type Web JavaScript with code

If you open the form in a browser you can check that by pressing the button, the value of the field is not displayed because “document.forms[0].MyHiddenField is undefined”; as you can see, the source code of the html page is:

where there is not any “input” tag with name “MyHiddenField”.
To force domino to generate the html code for the hidden fields you can enable the check box “Generate HTML for all fields” in the second label of the properties of the form, as you see in the figure:
generate html
This method has the disadvantage of creating the html code for all fields including hidden fields that it is useless to pass to the browser because they are not used, or worse, those fields that for security reasons you don’t want to pass to the browser.
If you prefer to decide which fields pass to the browser then you have 2 options:

  1. for editable fields you can add the property to the field
    type=”hidden”

    • or inserting into HTML Attributes as shown (note the use of the character \ as escape character)
      html attributes
    • or inserting it in the properties of the field
      html attribute properties
  2. for computed fields, enter before the field
    <input type=”hidden” name=”MyHiddenField” value=”
    and after the field insert
    ” />
    then select all the text and from the lotus menu under the label Text enable the “Pass-Thru HTML” so the final result is:
    pass thru html

You can verify that by using one of these methods the field “MyHiddenField” is hidden but still accessible via javascript.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.