Issue when using page template
I had a working page which I moved contents to a new page based on a template.
It contains a collapsible component and I have the following js in the response mapping for the component heading such that I get first and last name labels.
codevar firstname = value;
var lastname_element = element.closest("[name=edit_client]").find("[name=lastname_label]");
console.log("lastname_element = ",lastname_element);
var lastname = lastname_element.text();
console.log("lastname = ",lastname);
return firstname + " " + lastname;/code
The lastname is not being returned.
The console shows that the lastname_element is as follows and clearly shows the lastname: 'Black'
The lastname value is as it was at design time:
I just cannot see why it is not returning the correct value in my js.
I must have the correct js, or it would not return the design time text!