Country field validation for two fields?

Hi. I want to check if user has selected same country in two fields.

I’m doing a shipping form where user selects two countries where to ship from and to, user shouldn’t be able to select same countries for both address fields.

I know there’s this: gform_field_validation - Gravity Forms Documentation - but it only works for one address field at the time. How can I check two address fields and hide the submit button or just spit out an error when two countries are the same? Thanks.

Please see example 5 of gform_field_validation for comparing two fields:

Thanks. However, I still don’t fully understand how I should do it.
I’m not sure what would be the correct syntax to get 51.6 field (country of address fields.) for this:

$master = rgpost( ‘input_1’ );

The country portion of the advanced Address field, for field 51 in the form would be this:

$master = rgpost( 'input_51_6' );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.