Hi
I'm sitting on the dumbest thing for a lot of hours.
How can i check if two fields?(emails) are the same?
I'm using a regular FAPI
I've created 2 elements
$form['email'] = array(
'#title' => t('Email'),
'#type' => 'emailfield',
'#default_value' => !empty($form_state['values']['email']) ? $form_state['values']['email'] : '',
);
$form['email_verification'] = array(
'#title' => t('Email verification'),
'#type' => 'emailfield',
'#default_value' => !empty($form_state['values']['email_verification']) ? $form_state['values']['email_verification'] : '',
);
How can i check if those 2 are the same??
10x!
Comments
Comment #1
doronsever commentedWell, one thing working with drush is that you don't always remember that the module is based on another module.
this time its Form API Validation.
to check if 2 items are equal you need to add the match_field[otherfield] rule.
for my exmple
Hope it helps some one :)
Comment #2
attiks commentedGlad it works
Comment #4
arun ak commentedHi,
I have tried this, it did not work as well,
What I did is, I have a added a new custom field in to user registration form. I want to check default user account email field and my custom email field having same value.
My code:
If I disable clientside validation for this form, then 'match_field' validation working with normal php form submission. But match_field validation is not working with clientside validation.
Please help.
Comment #5
arun ak commentedComment #6
attiks commentedDo you get any errors in the browser? Are all needed submodules enabled?
Comment #6.0
attiks commentedput the code in code tags
Comment #7
jelle_smatch_field support added to latest dev version.