Emps-World Forum
Miscellaneous => Computers and Technology => Topic started by: Knight Night on March 21, 2016, 04:39:51 pm
-
Hello,
So if anyone can help me with this it would be really appreciated, so basically a user will be asked to write his e-mail address, and if there's a mistake by the e-mail form, it should ask him back to re-type it
example for a complier:
Type your e-mail address:
naseem1@hotmailcom
invalid input, please try again.
naseem1@hotmail.com
press any key to....
Thanks.
-
I think the easiest way would be to check if the email is containing an at sign (@) and a dot (.). Do you need specific code or is the logic enough for you?
-
I think the easiest way would be to check if the email is containing an at sign (@) and a dot (.). Do you need specific code or is the logic enough for you?
I'd understand what you referring for but could you show me a specific code if you can, and thanks.
-
Put this under a button click code
if(textbox.Text.Contains(.) && textbox.Text.Contains(@) && textbox.Text.Length > 0){
Correct email}
else{Incorrect email}
You'll have to change 'textbox' to the textbox that the email will be written in.