Jump to content

delete all characters after


randdevin

Recommended Posts

Customer is wanting to force an email address to use a certain FQDN.

they only want the customer to enter everything before the @.

 

Issue is some people can't read and they enter the full email address.

So were looking at removing the complexity for the end users and create a rule that is smart enough to remove the @ and everything after.

 

Thanks for your help.

Link to comment
Share on other sites

Thanks step...

What you supplied is always assuming that they supply the @.

See some users know to only enter everything before the @ while others do not.

 

Not sure I follow. If they don't supply the '@domain.com', it doesn't need to be removed.

 

return 'jdoe'.replace(/@.*/, '');           // returns jdoe
return 'jdoe@gmail.com'.replace(/@.*/, ''); // returns jdoe

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...