I have fields like password,conform password and gender in my registration page
password edit text
conform password edit text
gender (button01)/(button02)
for password and conform password i want to validate both fields ,I mean the entries(string value) of both fields should be same. If both are same then I want to pass only password value to the server not both values and In case of gender when I click button 01, I want to pass the input as male(string) to server and same in case of female also. How can I do this?
Help is always appreciated...!
Hi I am very new for android and in my app I have Validations for Change password page. That means the Password must contain minimum 8 characters at least 1 Alphabet, 1 Number and 1 Special Character, for this I tried the code below, but it's not working. Please help me.
An exception is when the confirmation password doesn't match the first entry, that pops up a toast. It would be better to handle validation errors consistently, by using setError for mismatched confirmation password.
Most validation errors call setError of the relevant input field. An exception is when the confirmation password doesn't match the first entry, that pops up a toast. It would be better to handle validation errors consistently, by using setError for mismatched confirmation password.
Check Password.
Here i write one function for compare password and conform password . In that function you need pass both the password and it will return true if both password are same and return false if both are different.
public boolean checkPassWordAndConfirmPassword(String password,String confirmPassword)
{
boolean pstatus = false;
if (confirmPassword != null && password != null)
{
if (password.equals(confirmPassword))
{
pstatus = true;
}
}
return pstatus;
}
Gender Button
As you said that here you are taking two button for gender . One is for male and another is for female . so you when user click on male button you have to take one string variable and assing the "male" value to that string, if user click female then you have to set "female" to that variable and pass to the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With