Account Settings (name, email, password) can be accessed by users clicking the Account Setting link. This brings up a Knack-default form. The Account Settings form allows users to make changes to their name and
email address.
If you do not want them to make changes, you can use the code below.
The Account Settings view is a Knack-default view. No view can be defined for this in the Interface hence the use of the ".any" view selector.
#first, #last are the field names for first name and last name. You can't use the field_xx names in the User Object.
field_253 is the field name for the email address as per the User Object.
// do not allow users to change their name or email address.
// // #first is the fieldname for the first name, #last is the fieldname for the last name.
// field_253 is the fieldname for the email address.
$(document).on("knack-view-render.any", function(event, view) {
$("#first").attr("disabled", "disabled");
$("#last").attr("disabled", "disabled");
$("#field_253").attr("disabled", "disabled");
})
Can you tell me how to add something to your code that puts a space in between the headers, and maybe even adjust the style of each so that it looks a little prettier?
The 2 headers together like this looks like something is missing!
I think what you proposed will disable the name fields on any form, which may not be the desired outcome. Also not sure where you got the field number for email - mine is different. But the following code will specify the name fields based on a class of account settings - this only affects those forms: