My form has a single line field named EmpType that is populated by a lookup rule. Then I have a custom HTML field with the following code:
<div align="center"><b><label id="lblEmployeeType"></label></b></div>
In javascript, I am populating lblEmployeeType.innerHTML with the value from the EmpType field because I want to use the employee type in a sentence and not see the field box outline. For instance, "As a [EmployeeType], you will receive the following benefits..."
if($("#Field16").val() == FT")
{
lblEmployeeType.innerHTML = 'Full Time';
}
else if ($("#Field16").val() == "PT")
{
lblEmployeeType.innerHTML = 'Part Time';
}
When I execute the form, it comes up as I expect, but upon clicking save everything is saved to the repository except the html field I populated.
It appears that that when the form is initially rendered the js for the html had not fully executed. Therefore, when it saves it does not save properly. I have noticed that if I change the innerHTML to equal a literal (without basing it on the value in the form) it will persist the form properly. My question is why will it not persist the form properly when the html field is populated from field that was populated by a lookup?
Any help is greatly appreciated.