Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

How do I force the signup to be the user's email?

Hello,

I am trying to force the users for when they sign up it needs to be an email. After creating a (working) signup service, I added JavaScript in the "Before Send" row located under the signup service:

var username = Appery('username').val();

function validateEmail(email) {
if (email === "") {
alert("Please enter an email address");
return; //return user to fix email address
}
var reg = /[A-Za-z0-9-.]+@([A-Za-z0-9-.])+.([A-Za-z]{2,4})$/;
if (reg.test(email) === false) {
alert('please enter a valid email address');
return;
}
}
validateEmail(username);

Is this code correct? Or is there something else I am missing?
Thank you guys so much in advance for answering, it means so much to have an amazing customer service got my back!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How do I force the signup to be the user's email?

Hi Logan,

Please check this forum topics, let us know if they helped:
:: https://getsatisfaction.com/apperyio/...
:: https://getsatisfaction.com/apperyio/...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How do I force the signup to be the user's email?

Hi Logan,

You can place this code in new Javascript asset.

And then on button click you can use following code:

pre

var userName = Apperyio("userNameInput").val();

//If userName from input email
if(validateEmail(userName)){
//Execute service
service.execute();
}
else{
alert("User name should email");
}

/pre

That's all

Regards.

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

How do I force the signup to be the user's email?

Thank you so much!

I am so happy there is such a strong customer support team at Appery!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do I force the signup to be the user's email?

Hi Logan,

Thank you for the feedback!

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

How do I force the signup to be the user's email?

;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

How do I force the signup to be the user's email?

;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1

Return to “Issues”