Some issues with "enable Other choice"-field

Hi there,

I’m using the “Enable other choice” on a radio button field. The values of the defaults are currency values. However, on the “other” field you’re allowed to enter text. Is there a way to limit this to numbers only?

I have also tried to replace the placeholder with the following code. That works, however it replaces both the placeholder AND label. Is there a way to separate (and modify) the two?

add_filter( 'gform_other_choice_value', 'set_placeholder', 10, 2 );
function set_placeholder( $placeholder, $field ) {
    if ( is_object( $field ) && 6 === $field->id && 25 === $field->formId ){ // 6 and 25 to your field id and form id number.
        $placeholder = 'My Custom Text';
    }
    return $placeholder;
}

Best,
Dave

That’s the expected, there’s no separate filter.

You can create your own custom validation function to abort the submission if the value doesn’t fit your needs using the following filter: gform_field_validation - Gravity Forms Documentation

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