Java script on computed fields

I am unable to validate a computed field using java script. i get a message that the value is null or not an object. if i make the field editable and not hidden it works fine?

Is this normal or am i coding incorrectly? this is used on the On click event on a button.

var due = document.forms[0].effdate.value;

var rel = document.forms[0].release.value;

if(due < rel);

{

alert("The completion date can not be earlier than the date communicated to the store");

doc.effdate.focus();

check = false;

}

Subject: java script on computed fields

Assuming you don’t want to validate the computed field but instead want to get the value of it to use in validating another field…

When the page is served up on the Web computed fields are turned into hidden input fields with a name but no ID, so JavaScript cannot find them. A workaround is to put a passthru HTML hidden input field that has a computed value of your computed field. I always give this passthru field a different ID (in case someone down the line changes the computed field to editable) and then use the passthru in the JavaScript.

E.g.,

where Computed Value is release.

Hope this helps.

Subject: RE: java script on computed fields

it does thank you.