Hi, I would like instead of doing all Address Field required, to make only the field City and the field Country required.
Can this be done?
Thank in advance for any help provided.
You can make some of the "subfields" of the address field required (or remove the requirement) using the frm_validate_field_entry hook. If the past I've done something like the following (which removes the requirement from the line 1, line 2, state and zip fields) :
add_filter('frm_validate_field_entry', 'your_method_name, 10, 4); function your_method_name($errors, $posted_field, $posted_value, $args) { $addressFieldId = ???; // put your field id here if ($posted_field->id == $addressFieldId) { unset($errors['field' . $posted_field->id]); unset($errors['field' . $posted_field->id . '-line1']); unset($errors['field' . $posted_field->id . '-line2']); unset($errors['field' . $posted_field->id . '-state']); unset($errors['field' . $posted_field->id . '-zip']); } }
Please login or Register to submit your answer