473,388 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 1854
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****************@TK2MSFTNGP03.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 requirevalidator in the same column, my
email if i use both require and regulrexpression 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.comwrote in message
news:eh**************@TK2MSFTNGP06.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****************@TK2MSFTNGP03.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**************@TK2MSFTNGP02.phx.gbl...
Thanks for your email

I've other controls which i use requirevalidator in the same column, my
email if i use both require and regulrexpression 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.comwrote in message
news:eh**************@TK2MSFTNGP06.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****************@TK2MSFTNGP03.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.comwrote in message
news:O0**************@TK2MSFTNGP03.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**************@TK2MSFTNGP02.phx.gbl...
>Thanks for your email

I've other controls which i use requirevalidator in the same column, my
email if i use both require and regulrexpression 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.comwrote in message
news:eh**************@TK2MSFTNGP06.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****************@TK2MSFTNGP03.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 #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 RegularExpressionValidator
succeeds validation if the input control is blank. And if a value is
required, you should use a RequiredFieldValidator in addition to the
RegularExpressionValidator control.

Aug 16 '07 #6

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

Similar topics

6
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...
6
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...
4
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,...
0
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....
23
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...
3
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...
11
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...
1
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.