In short, I want to know how to disable validation of a field, regardless its value. I'm using Javascript to dynamically change the values of pricing checkboxes based on user input in other fields. It seems that something in the standard validation of checkboxes causes a failure whenever the values are altered in the DOM.
So I looked at the validation hook and tried to bypass validation of the field by adding a class "skipValidation" to the checkboxes and setting $field['failed_validation'] = false;
http://www.pastie.org/2450179
But the front-end effect of this is only to give the appearance that the field is valid. The form itself still seems to be invalid and displays "There was a problem with your submission. Errors have been highlighted below." But there are no actual errors highlighted.
It seems to me that I can't actually just validate the whole form with $validation_result['is_valid'] = true;
because then none of the other fields will attempt validation, and I've essentially turned off validation for the entire form.
I think my method would actually work if I wasn't using a multiple input field like checkboxes. The validation hook documentation seemed to indicate something is different about checkboxes: "This method for retrieving the field value will work for most fields. Known exceptions are checkboxes and fields with multiple inputs. We will cover those later as an addition to this walk-through." I couldn't find this additional document covering these exceptions.
I need to use the pricing options because I'm trying to send additional costs to Cart66, which picks up the cost increases when I add, for example, " +$1000" to the value of the choices. However, the additional costs are not fixed and need to be calculated, so I'm using Javascript to calculate and modify the input values in the DOM. Here's what I'm doing to the HTML:
http://www.pastie.org/2450390
In summary, I would appreciate if someone can help me to bypass validation of a specific set of checkboxes or show me another way to get Cart66 to pick up dynamically calculated cost increases to a product when integrated with Gravity Forms. Thanks.
P.S. I only code a little Javascript, so please try to explain any PHP answers simply. Also, I can't post a URL to a live example, as I'm still in development.