email and mobile number verification with Yup - yup

Validate 'email' and 'mobile number' in the same input with Yup.
I have an 'entry' where I want to check mobile number and email. I left the input with type='text', but in the yup check I didn't find a way for it to differentiate the email or the mobile number.

Related

custom data validation in angular 4

i'm using my angular 4 app as a frontend application using web services .
i have a component that showing form user details . so to validate my form i have a one cretaria is all full inputs (user information) that was imported from the web services is required .
for exemple if have username and telephone inputs showing in my updatecomponent and the username are 'xxxxxxx' and telephone is empty , if i try to clean the username input and submit the form , it should not submitted because the username was not empty from the backend and i have to mention like a warning to fill the username input for submit the form . and for the telephone input , there is no problem , because the input came empty from the start .
so what kind of validation form may i do ?
You can use form validation.
This article can helps you:
https://angular.io/docs/ts/latest/cookbook/form-validation.html

how could I recognize an email as auto-forward email?

I have a task which needs me to find out the auto-forward email from an email set.
Originally I recoginize an email whose sender contains "caf_|auto_" and "+" and "_" as auto-forward email,for example "test3128+caf_=test3128=yahoo.com#gmail.com".
But finallly I find that the above-mentioned feature is not always right.Because the email may be an auto-forward or an auto-reply email.
Could anyone give me any help?You have my thanks.

Drupal 7 Webform - Allow anonymous user to edit previous submission

I'm pretty sure this is not possible, but I was wondering if anyone can think of a way to allow anonymous users to edit webform submissions. We are allowing users to sign up for a job search agent where they anonymously provide their email address and then submit a few preferences on the type of jobs they are looking for and then we email them jobs that are available when they become available. We don't want these users to have to create an actual Drupal registration and have to remember another password. We want it to be super easy for them. So they can submit the form anonymously, but the problem is if they want to come back and edit their preferences at a later date, they can't because Drupal wont know who they are. I was thinking of possibly creating an official user registration behind the scenes using their email address and a basic password when they submit the webform and when they come back to the site, they provide their email address in a separate form I create in a custom module, then I can do a user lookup based on the email address and auto log them in (if that's even possible) and then send them to the webform? Do you think that would work, or is their a better solution to this predicament?
I think your solution will work. I've done something similar in the past.
Users just logged in by visiting a particular url such as /login/USER_NAME. Then you can send out emails with this link and they are automatically logged in as soon as they hit the site.
To create the users account use something like this:
$new_user = array(
'name' => $name, // this could also just be the email address if you are not collecting a name
'pass' => 'password', // hardcoded password - same for every user
'mail' => $email,
'status' => 1,
'init' => $email,
);
user_save('', $new_user);
Then to log them in you can use:
if ($uid = user_authenticate($username, 'password')) {
global $user;
$user = user_load($uid);
$login_array = array ('name' => $username);
user_login_finalize($login_array);
}

HTML form - check if email entered correctly?

I creating Contact us form and i want in email section that if email entered wrong way (not name#example.com), user wouldn't be able to submit form.
input:
<input name="email" type="text" value="" size="30"/>
With regexp using javascript/php (or whatever) you would be able to validate an email format : presence of "#", presence of ".dom", but you will have to hard code to avoid something like "example.com".
I would suggest to use a validation/activation mechanism : send an email with a link, when user click the link you receive a notification, that means that email is valid so you can take care of it !
You can check this topic : Validate email address in JavaScript?
But it does not take care about something like "name#example.com".
As Mike W said in comments, the only way to validate a valid email is to send an email.
Also, you could have fun trying to trap auto-response for invalid email by checking the sender mailbox ;)

Drupal Webform email receipt

I'm trying to set up an email receipt to send to the user who fills out the form.
I'm using Webform 6.x-3.1. On this help page for Webform "admin/help/webform" it hints at that function by stating this "Once finished adding fields, you may want to send e-mails to administrators or back to the user who filled out the form. Click on the Emails sub-tab underneath the Webform tab on the piece of content."
It looks like they took out the "Additional processing" ability with this version.
I tried adding an hidden email field under the "E-mails" tab to send an email to the form submitter but didn't work. What I di was add a hidden field called "email_user" and for the default value, gave it %post[email] because the email field they fill out is "email". It doesn't look like it's grabbing the post.
Does anyone have this working or understand how to get it done?
I think you might be misunderstanding the E-mails subtab. For an example, start fresh with a new Webform node and try this:
In the "Form components" subtab, add three components: "Example First Name" (type: textfield), "Example Last Name" (type: textfield), and "Example Email Address" (type: email). For this example, mark them all as "Mandatory" (although I don't think that setting is required for confirmation emails).
Check out the "E-mails" subtab. See how the "Component value:" dropdown now displays "Example Email Address" as an option? Leave that selected, and click on the "Add" button to the right.
On the next page, you can define the email header and body, as I'm sure you've seen before. Note at the top, however, the E-mail to address: field, which still has your "Example Email Address" component selected. This means that the confirmation email will be sent to the email address that is entered in the Example Email Address form field upon submission.
Now click the "View" tab and try out your form: Enter an example name and a real email address, submit, and check to see if you receive the Webform-generated confirmation email.
In short: you don't use the E-mails subtab to define additional fields/components for your form; you use it to select which existing form field(s) should be the recipient of a confirmation email.