I'm having trouble with AJAX Code Validation on a normal Checkbox (Multiple) field. I have 5 options, and I want users to be able to possibly select multiple options EXCEPT a specific combo of two (example: options a, b, c, d, f. They can select any except b and c together.) However, I can't get Code Validation with AJAX to work. All profile edits are done via profile view through AJAX fields. Edit Profile only displays the basic username, email, and name. For the sake of testing, I have set the PHP for Code Validation to return false; to force an error. However, when editing the AJAX field, this is thrown in the browser Dev Console as I change check box selections in AJAX editing:
Code:
jquery.cbvalidate.min.js?v=97c6c7d74dea204d:1 Uncaught TypeError: Cannot read property 'valid' of null
at Object.<anonymous> (jquery.cbvalidate.min.js?v=97c6c7d74dea204d:1)
at u (jquery-2.2.4.min.js?v=97c6c7d74dea204d:1)
at Object.fireWith [as resolveWith] (jquery-2.2.4.min.js?v=97c6c7d74dea204d:1)
at u (jquery-2.2.4.min.js?v=97c6c7d74dea204d:1)
at XMLHttpRequest.<anonymous> (jquery-2.2.4.min.js?v=97c6c7d74dea204d:1)
Community Builder 2.4.2
CB Code Field 2.0.0+build.2019.03.21.15.21.42.54835dad0
PHP Version 7.1.29
Joomla! Version Joomla! 3.9.5 Stable [ Amani ] 9-April-2019 15:00 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Enable debug mode and maximum error reporting in Joomla global configuration then retry. This should allow the error to provide an actual line number that can be investigated to see where in the JS it's failing. Please note your PHP should be returning a true or false only.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Uncaught TypeError: Cannot read property 'valid' of null
at Object.<anonymous> (jquery.cbvalidate.js?v=97c6c7d74dea204d:1102)
at fire (jquery-2.2.4.js?v=97c6c7d74dea204d:3190)
at Object.fireWith [as resolveWith] (jquery-2.2.4.js?v=97c6c7d74dea204d:3320)
at done (jquery-2.2.4.js?v=97c6c7d74dea204d:8760)
at XMLHttpRequest.<anonymous> (jquery-2.2.4.js?v=97c6c7d74dea204d:9126)
Looks like something is breaking the validation endpoint. Seams to be working fine in my tests. Please PM backend super administrator login credentials and note what field is failing validation to reproduce your issue and will take a look. It's possible something is doing an echo and breaking the JSON response of the validation endpoint.
That error could only happen if the following check failed.
So either the function value in the URL of the validation endpoint is being altered or the field isn't properly accessible for ajax validation, but if it's not accessible for ajax validation it shouldn't have been possible for it to attempt validation to begin with.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.