Error: Cannot read property 'value' of undefined

  • 1
  • Problem
  • Updated 1 year ago
  • Not a Problem
  • (Edited)
I've included a signup form in my website via the "javascript object" publishing method. This form contains custom fields I've added such as "Full Name", "Phone" and "Company". 

I'm getting the error in the title of this post on submit when there are clear validation issues (e.g., empty fields). 

The issue is there's reference errors in your javascript. For example:
The custom form input elements are given names like "member_field_full-name", but your javascript attempts to reference an element with the name "full-name". This results in an error and the form doesn't validate properly. 
Photo of Atelier BHS

Atelier BHS

  • 1 Post
  • 0 Reply Likes
  • frustrated

Posted 1 year ago

  • 1
Photo of Laura Dickerson

Laura Dickerson, Official Rep

  • 778 Posts
  • 64 Reply Likes
Official Response

The reason the JS form is referencing an element called "full-name" is because it is the shortcut name for the field in Emma. The error with validation issues (the example being empty fields) is because of the being fields assigned as required - which would make that error make sense if its empty. Could you make that full name field not required and see if that changes the behavior you're seeing. If you are still having problems provide the URL for the site where the form is embedded and then we can try to replicate it.