|
|
|
start date: Thu, 16 Aug 2007 19:22:17 +0100,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Ganesh
|
|
2
Mike
|
|
3
Ganesh
|
|
4
Mike
|
|
5
Ganesh
|
|
6
Alexey Smirnov
|
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
Date:Thu, 16 Aug 2007 19:22:17 +0100
Author:
|
Re: validate email and checks blank as well
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" wrote in message
news:%23pBJmJD4HHA.4880@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
>
Date:Thu, 16 Aug 2007 14:25:23 -0400
Author:
|
Re: validate email and checks blank as well
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" wrote in message
news:ehjiPLD4HHA.2312@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" wrote in message
> news:%23pBJmJD4HHA.4880@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
>>
>
>
Date:Thu, 16 Aug 2007 19:40:53 +0100
Author:
|
Re: validate email and checks blank as well
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" wrote in message
news:ONDQ$TD4HHA.3600@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" wrote in message
> news:ehjiPLD4HHA.2312@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" wrote in message
>> news:%23pBJmJD4HHA.4880@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
>>>
>>
>>
>
>
Date:Thu, 16 Aug 2007 14:47:12 -0400
Author:
|
Re: validate email and checks blank as well
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" wrote in message
news:O0p8bXD4HHA.5740@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" wrote in message
> news:ONDQ$TD4HHA.3600@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" wrote in message
>> news:ehjiPLD4HHA.2312@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" wrote in message
>>> news:%23pBJmJD4HHA.4880@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
>>>>
>>>
>>>
>>
>>
>
>
Date:Thu, 16 Aug 2007 20:03:38 +0100
Author:
|
Re: validate email and checks blank as well
On Aug 16, 9:03 pm, "Ganesh" wrote:
> 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.
Date:Thu, 16 Aug 2007 12:19:17 -0700
Author:
|
|
|