Hi,
Does anybody knows how to write a java script code to get the value of a computed field in a notes form, I’m using the function below but is not working for me I’m getting an undefined value and the computes field does have a value.
thanks
Hi,
Does anybody knows how to write a java script code to get the value of a computed field in a notes form, I’m using the function below but is not working for me I’m getting an undefined value and the computes field does have a value.
thanks
Subject: java script code to get the value of a computed field in a notes form
Hi,
Make sure the form property “Generate HTML For All Fields” is checked.
Rgds,
Paras
Subject: RE: java script code to get the value of a computed field in a notes form
Hi,
I’m doing this in the JSHeader event, so the field get validated in web.
Subject: RE: java script code to get the value of a computed field in a notes form
And how does that effect Paras’s answer to you?
Subject: RE: java script code to get the value of a computed field in a notes form
Hi, Thanks for your answer, I’m just doing a research to find out how can I return the value of a computed field using java script.
Subject: Did you do what Paras suggested
and then look at the source of the page?
Subject: RE: java script code to get the value of a computed field in a notes form
There are two problems here. One is that computed fields are not rendered as fields/form elements by default on the web. Only their contents (when the field is not hidden) are rendered as text. That leaves you with three choices:
PROBLEM: it generates HTML form elements for ALL fields, and on the web (unlike in the Notes environment) hiding a field is actually secure – you may not want that information leaking out into the world.
PROBLEMS: You may want to USE the field content, but you still may not want it available to your end users to read or modify, and in the case of computed fields, you now have user-submitted data that may be in conflict with your computation.
That’s the first set of problems. The other thing is that computed data doesn’t need to be validated. It is either correct based on the LAST values submitted (and, thus, potentially invalid based on the CURRENT data on the web page) or has not been computed yet at all (since the user data has not been submitted). Remember that computed fields (and computed text) are computed on the server, not in the web browser. It’s out of the user’s control. It is fair to USE computed data in order to validate editable information (although there are better ways to restrict user inputs than validation in that case), but it is not fair to make the user responsible for the result of a computation over which they have no immediate control.