Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Memberprofiles - Check email field only accept valid email


Go to End
Reply


11 Posts   2346 Views

Avatar
ocean

Community Member, 37 Posts

27 February 2014 at 11:28am

This still seems to be an issue today with latest code, an otherwise really nicely done module is more or less useless for real life use because any old nonsense can be typed into the email field and it posts.

Anyone managed to get an answer or solution on this one?

Would love to know!

Thanks
Sean

Avatar
ajshort

Community Member, 244 Posts

27 February 2014 at 3:34pm

I just tested this, and it works fine as expected. You just need to replace the email field with an EmailField rather than a TextField using updateMemberFormFields.

Avatar
ocean

Community Member, 37 Posts

1 March 2014 at 2:25am

Thanks Andrew!

I've updated with the following code and can confirm the JS require valid email is now working.

MemberExtension.php

class MemberExtension extends DataExtension {

public function updateMemberFormFields(FieldList $fields) {
$fields->push(new EmailField('Email', 'Email'));
}

}

_config.php

Object::add_extension('Member', 'MemberExtension');

Go to Top