ragunathjawahar / android-saripaar

UI form validation library for Android
Apache License 2.0
3.22k stars 460 forks source link

I can't change the confirm password message #184

Closed OsmundWare closed 7 years ago

OsmundWare commented 7 years ago
public class MainActivity extends AppCompatActivity implements Validator.ValidationListener {
    private Button registrar;

    @NotEmpty (message = "Este campo es requerido")
    @Password (min = 6, scheme = Password.Scheme.ALPHA_NUMERIC_MIXED_CASE)
    private EditText password1;

    @NotEmpty (message = "Este campo es requerido")
    @ConfirmPassword (message = "password no funciona")  // ----> ("here") 
    private EditText password2;

    // ...
}

The final running message just show = "Passwords don´t match" default message.

ashraffouad commented 7 years ago

Hi @OsmundWare

It is working for me using messageResId attribute, try as below:

@NotEmpty (messageResId = R.string.error_field_required)
@ConfirmPassword (messageResId = R.string.error_field_password_donot_match) 
private EditText password2;
ragunathjawahar commented 7 years ago

@ashraffouad is right, use the message or messageResId attribute.