Skip to Content Skip to Menu

🐰 Happy Easter! Great savings on Professional and Developer Memberships! Get 20% off now with code EASTER-2025!

Code to pull CB field title

12 years 3 months ago - 12 years 3 months ago #217639 by SustainableBusiness
Code to pull CB field title was created by SustainableBusiness
I added the following code to cb.validator.php around line 58 to make a pop-up message if validation fails.
Code:
$('#cbcheckedadminForm').submit( function() { var v = $(this).validate(); v.cbIsFormSubmitting = true; var r = $(this).validate().form(); v.cbIsFormSubmitting = false; if ( ! r ) { //Start of added code var messages = "Error with one or more entries:\n"; for ( var i = 0; v.errorList[i]; i++ ) { messages += v.errorList[i].element.name + ": " + v.errorList[i].message + "\n"; } alert( messages ); //End of added code $(this).validate().focusInvalid(); } return r; } );
Instead of v.errorList.element.name, which pulls the name attribute from the HTML input element, I'd like to somehow pull the field title from the corresponding CB field. Is that possible, and if so, how would I do that?
Thanks for the help.
Last edit: 12 years 3 months ago by SustainableBusiness.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum