Document.forms[0].field.value

Hi there !

I want to get a value from a field in a document and put the value in my JS header script.

I get the value like this from a field named dbpath:

path = document.forms[0].dbpath.value

But I get an error message that says: document.forms[0].dbpath.value is null

or not an object.

the field is a hidden notes field and computed with a value, so it is not empty.

The document does not have the “Generate HMTL for all fields” - it still doesn´t work with it enabled. I should also mention that the field is in a subform within the document.

Does any body know why I get this message ?

Subject: document.forms[0].field.value

In read mode, no fields are rendered.

What you can do, is add this line:

passtru html.

This will give you the field in read and edit mode (you’ll need to hide the actual field using a hide formula)

Another possibility is to load the values you need into javascript variables.

Add a script to html header section like this:

“”

You then can use the variables you set here in all your javascripts.

cheers,

Tom