473,581 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validate email and checks blank as well

Hi There,

I need to validate email address with regular expression control, i tried
something like this

^+[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$

but i need to validate even if it is blank, it should say invalid email, but
don't want to use another requirefield validator

Thanks
Ganesh
Aug 16 '07 #1
5 1867
then use javascript. but why do that since you can use the required field
validator? Just drag and drop it to your page, pick your email textbox to
validate and your done.

Hell its there and it saves time, use, I don't see or understand why you
wouldn't in a case like this.
"Ganesh" <gs******@yahoo .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi There,

I need to validate email address with regular expression control, i tried
something like this

^+[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$

but i need to validate even if it is blank, it should say invalid email,
but don't want to use another requirefield validator

Thanks
Ganesh

Aug 16 '07 #2
Thanks for your email

I've other controls which i use requirevalidato r in the same column, my
email if i use both require and regulrexpressio n it will be aligned in just
further right. I thought if i can use expression itself it would be good.

i'm not expect in regular expression, i think there must be a way to
validate

Thanks
Ganesh

"Mike" <Mi**@community .nospam.comwrot e in message
news:eh******** ******@TK2MSFTN GP06.phx.gbl...
then use javascript. but why do that since you can use the required field
validator? Just drag and drop it to your page, pick your email textbox to
validate and your done.

Hell its there and it saves time, use, I don't see or understand why you
wouldn't in a case like this.
"Ganesh" <gs******@yahoo .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Hi There,

I need to validate email address with regular expression control, i tried
something like this

^+[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$

but i need to validate even if it is blank, it should say invalid email,
but don't want to use another requirefield validator

Thanks
Ganesh


Aug 16 '07 #3
you can still user a required field validator, just format the HTML so they
appear as you want.
I don't see any sense in making extra work for something that can be done in
like 30 seconds - if that

right now I have a form with 4 textboxes and are all required and 2 i'm
using expression.
I have all the controls formattted via HTML so they show on the page nice
and neat.

"Ganesh" <gs******@yahoo .comwrote in message
news:ON******** ******@TK2MSFTN GP02.phx.gbl...
Thanks for your email

I've other controls which i use requirevalidato r in the same column, my
email if i use both require and regulrexpressio n it will be aligned in
just further right. I thought if i can use expression itself it would be
good.

i'm not expect in regular expression, i think there must be a way to
validate

Thanks
Ganesh

"Mike" <Mi**@community .nospam.comwrot e in message
news:eh******** ******@TK2MSFTN GP06.phx.gbl...
>then use javascript. but why do that since you can use the required field
validator? Just drag and drop it to your page, pick your email textbox to
validate and your done.

Hell its there and it saves time, use, I don't see or understand why you
wouldn't in a case like this.
"Ganesh" <gs******@yahoo .comwrote in message
news:%2******* *********@TK2MS FTNGP03.phx.gbl ...
>>Hi There,

I need to validate email address with regular expression control, i
tried something like this

^+[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$

but i need to validate even if it is blank, it should say invalid email,
but don't want to use another requirefield validator

Thanks
Ganesh



Aug 16 '07 #4
Thanks, I'll follow the way if there is no way.

Still i'd prefer if anyone have answer for my question, one is my learning
purpose just want to know how to do this. Next thing defintly in future i'm
going to have more regular expression don't want to use both(require and
regular expression)

Thanks

"Mike" <Mi**@community .nospam.comwrot e in message
news:O0******** ******@TK2MSFTN GP03.phx.gbl...
you can still user a required field validator, just format the HTML so
they appear as you want.
I don't see any sense in making extra work for something that can be done
in like 30 seconds - if that

right now I have a form with 4 textboxes and are all required and 2 i'm
using expression.
I have all the controls formattted via HTML so they show on the page nice
and neat.

"Ganesh" <gs******@yahoo .comwrote in message
news:ON******** ******@TK2MSFTN GP02.phx.gbl...
>Thanks for your email

I've other controls which i use requirevalidato r in the same column, my
email if i use both require and regulrexpressio n it will be aligned in
just further right. I thought if i can use expression itself it would be
good.

i'm not expect in regular expression, i think there must be a way to
validate

Thanks
Ganesh

"Mike" <Mi**@community .nospam.comwrot e in message
news:eh******* *******@TK2MSFT NGP06.phx.gbl.. .
>>then use javascript. but why do that since you can use the required
field validator? Just drag and drop it to your page, pick your email
textbox to validate and your done.

Hell its there and it saves time, use, I don't see or understand why you
wouldn't in a case like this.
"Ganesh" <gs******@yahoo .comwrote in message
news:%2****** **********@TK2M SFTNGP03.phx.gb l...
Hi There,

I need to validate email address with regular expression control, i
tried something like this

^+[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$

but i need to validate even if it is blank, it should say invalid
email, but don't want to use another requirefield validator

Thanks
Ganesh



Aug 16 '07 #5
On Aug 16, 9:03 pm, "Ganesh" <gsgan...@yahoo .comwrote:
Thanks, I'll follow the way if there is no way.

Still i'd prefer if anyone have answer for my question, one is my learning
purpose just want to know how to do this. Next thing defintly in future i'm
going to have more regular expression don't want to use both(require and
regular expression)
It's not possible by design, because RegularExpressi onValidator
succeeds validation if the input control is blank. And if a value is
required, you should use a RequiredFieldVa lidator in addition to the
RegularExpressi onValidator control.

Aug 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2322
by: deko | last post by:
I have a basic Feedback form - I want to prevent blank entries. The problem with the below code is that the form still Posts if the 'message' field is blank. The form will not post if the 'email_address' field is blank, however. Why doesn't it catch empty 'message' field? <form method="POST" action= "<? $message = $_POST;...
6
2112
by: xxnonexnonexx | last post by:
I am looking to do some email validation and many of the scripts I've located online are great basic email validators. They check to see that the email address is something along the lines of somethin@a_valid_host.at_a_valid_tld Thats great, looking for that, BUT I then want to EXCLUDE certain domains, ie: webmail hosts, or what ever...
4
4372
by: Fernando Lopes | last post by:
Hi. I have a page with a usercontrol. In this UC, I have two ListBoxes and two buttons. When i click in one button, i get the selected item in the listbox. How can i validate, using validators, if the selected listbox has a selected item? Thanks. Fernando
0
1712
by: comp.lang.php | last post by:
I wrote a method that should check if an email address is valid. In another method I've already checked to see if $_POST exists and is well-formed, so those checks are not necessary in this scope. However, "Step 4" bothers me, and I wonder if others are as bothered as I am. /** * Validate submitted email
23
2860
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which is not valid. Here's my attempt, neither of my regexps work quite how I want: import os import re
3
1751
by: Lord0 | last post by:
I *think* I need to be able to validate subsets of an XML document using different schema. The functionality I'm trying to implement is this. a) External suppliers produce an XML document containing multiple User records. The external supplier validates this entire document using schema 1. This document is then uploaded to our system. b)...
11
8153
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function to validate 3 types of fields: text, radio button, dropdown menu. but the code doesn't validate. After 2 days, it's time I asked for guidence....
1
2828
by: mbarnhizer | last post by:
Hello All, Trying to figure out how to validate a series of questions on an online test. I am thinking that VB or Javascript is the best route, but your input may make a difference. The site i am working with is using .asp. Their are 30 multiple choice questions. Each will have have 3 or 4 checkboxes where the test taker will choose only...
2
1937
by: Mick Walker | last post by:
Hi, I have a problem that I have been trying to figure for a couple of days, and am wondering if anyone out there would be so kind as to give me a solution. (Deadline time) I am trying to validate a form. Its quite a simple form, but I am a wee bit stuck. Baically it consists of 9 text input fields and a select element. All elements on...
0
7882
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6564
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1410
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.