- πΊπ¦Ukraine AstonVictor
I'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks
I try to apply a regex fapi validator on a text field, (used as an email address), to avoid noreply addresses.
But this not work:
$form['mail'] = array(
'#type' => 'textfield',
'#placeholder' => t('Email'),
'#maxlength' => 255,
'#required' => TRUE,
'#rules' => array(
array('rule' => 'regexp[/(^noreply)/]', 'error' => t('Please, use a valid email address.')),
),
);
I am finally successfully using as an alternative the form validate:
function MYMODULE_form_validate($form, &$form_state) {
if (!valid_email_address($form_state['values']['mail'])) {
form_set_error('mail', t('You must enter a valid email.'));
}
if (preg_match(('/^noreply|^no-reply/i'), ($form_state['values']['mail']))) {
form_set_error('mail', t('You must enter a valid reply email.'));
}
}
I tried several regexp combination with no success, I guess it could be a bug, or my misunderstanding of the api.
Closed: outdated
2.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks