Page 1 of 1

Is email field mandatory

Posted: Fri Apr 14, 2017 2:23 am
by alex4orly
I have a membership form, some members don't have an email address or maybe don't want to provide it.
It seems however that the Form Onsubmit is calling a function to check it.

Looking at the code (inserted by WWB), it seems that if the field is empty, it should just let it go, but it doesn't

function Validateeditprofileform(theForm)
{
var regexp;
regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
if (theForm.email.value.length != 0 && !regexp.test(theForm.email.value))
{
alert("Invalid email address");
theForm.email.focus();
return false;
}
return true;
}
</script>

Why?

Re: Is email field mandatory

Posted: Fri Apr 14, 2017 6:44 am
by Pablo
The email address cannot be empty. The length cannot be zero.

Re: Is email field mandatory

Posted: Fri Apr 14, 2017 12:25 pm
by alex4orly
What? Bad idea...
There are club members without an email address
There those who have an address but don't want to publish it.
Who's idea is that?
Why?

Re: Is email field mandatory

Posted: Fri Apr 14, 2017 12:30 pm
by Pablo
This is by design. Otherwise it options like 'email confirmation' and 'password recovery' would not be possible.
If you need different behavior then you will have to edit the script yourself.

RESOLVED: Is email field mandatory

Posted: Sat Apr 15, 2017 4:47 am
by alex4orly
OK, I understand

I arranged with the club secretary to assign a dummy email for those cases.

Now - I tried to implement the Password Recovery, set the object onto a new page by itself, but it fails.
entered my own email address - but it fails.
Is there any documentation on how to implement this?

Cheers

Re: Is email field mandatory

Posted: Sat Apr 15, 2017 7:02 am
by Pablo
What do you mean by 'it fails'?

Please note that it will not work if you do not have an email address associated with the account.

Re: Is email field mandatory

Posted: Sat Apr 15, 2017 7:10 am
by alex4orly
Fails as in - goes to the Error page
I am using my own email address, which is in the database that I am pointing it to

If you visit that URL and enter : alex4buba@gmail.com you can see what happens.

This object only has an input field and a submit button, there is no field to enter anything else in it

Cheers

Re: Is email field mandatory

Posted: Sat Apr 15, 2017 7:41 am
by Pablo
There are 3 reasons why the error page can be displayed:
- the database is not accessible.
- email address is not in the database
- the account is not active

Re: Is email field mandatory

Posted: Sat Apr 15, 2017 8:31 am
by alex4orly
Thanks Pablo

I will check all options

Re: Is email field mandatory

Posted: Sat Apr 15, 2017 11:02 pm
by alex4orly
OK, I had a typo in the email with one extra letter... It works fine now.
But this leads me to another question - if a member is flagged as Non-Active, can they still login if they know their password?

Otherwise, this is creating a problem for membership renewal...

Re: Is email field mandatory

Posted: Sun Apr 16, 2017 7:37 am
by Pablo
can they still login if they know their password?
No, users cannot login if the account is not activate, otherwise this option would not have any use.

Re: Is email field mandatory

Posted: Sun Apr 16, 2017 8:06 am
by alex4orly
Thanks Pablo,

I will add another field on the records to indicate if they paid membership

Cheers