Home All Groups Group Topic Archive Search About

Allowing entry of a Carriage Return during data entry

Author
27 Jul 2006 1:15 PM
Mike Owen
Hi,

I am using a ValidationExpression="^[a-zA-Z0-9 '.,]+$" on a
regularexpressionvalidator to restrict what is allowed to be entered in a
MultiLine textbox.

I would also like to allow the user to be able to enter a carriage return,
enabling them to be able to break up the text they enter, but unfortunately
despite all the additional bits that I have tried, e.g. adding \r between the
2 square boxes in the ValidationExpression, nothing seems to work.

How would I change the expression above to allow a CR to be entered?  (I
have just thought should I be adding CR & LF not just a CR?).


Thanks, Mike.

Author
27 Jul 2006 1:51 PM
Alessandro Zifiglio
hi Mike, if your looking to break into a newline then just a carriage return
wont suffice. along with \r issue a line feed also, so your expression will
be \n\r for allowing a break into a newline.

ValidationExpression="^[a-zA-Z0-9',.\n\r]+$"

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net


Show quoteHide quote
"Mike Owen" <whatnospam@nospam.nospam> ha scritto nel messaggio
news:FD2EFDA6-9DE9-43EB-93D1-EBABF8616420@microsoft.com...
> Hi,
>
> I am using a ValidationExpression="^[a-zA-Z0-9 '.,]+$" on a
> regularexpressionvalidator to restrict what is allowed to be entered in a
> MultiLine textbox.
>
> I would also like to allow the user to be able to enter a carriage return,
> enabling them to be able to break up the text they enter, but
> unfortunately
> despite all the additional bits that I have tried, e.g. adding \r between
> the
> 2 square boxes in the ValidationExpression, nothing seems to work.
>
> How would I change the expression above to allow a CR to be entered?  (I
> have just thought should I be adding CR & LF not just a CR?).
>
>
> Thanks, Mike.
Author
27 Jul 2006 2:25 PM
Mike Owen
Thanks Alessandro.

I was so close yet so far!


Cheers, Mike.

Show quoteHide quote
"Alessandro Zifiglio" wrote:

> hi Mike, if your looking to break into a newline then just a carriage return
> wont suffice. along with \r issue a line feed also, so your expression will
> be \n\r for allowing a break into a newline.
>
> ValidationExpression="^[a-zA-Z0-9',.\n\r]+$"
>
> Regards,
> Alessandro Zifiglio
> http://www.AsyncUI.net
>
>
> "Mike Owen" <whatnospam@nospam.nospam> ha scritto nel messaggio
> news:FD2EFDA6-9DE9-43EB-93D1-EBABF8616420@microsoft.com...
> > Hi,
> >
> > I am using a ValidationExpression="^[a-zA-Z0-9 '.,]+$" on a
> > regularexpressionvalidator to restrict what is allowed to be entered in a
> > MultiLine textbox.
> >
> > I would also like to allow the user to be able to enter a carriage return,
> > enabling them to be able to break up the text they enter, but
> > unfortunately
> > despite all the additional bits that I have tried, e.g. adding \r between
> > the
> > 2 square boxes in the ValidationExpression, nothing seems to work.
> >
> > How would I change the expression above to allow a CR to be entered?  (I
> > have just thought should I be adding CR & LF not just a CR?).
> >
> >
> > Thanks, Mike.
>
>
>
Author
27 Jul 2006 2:34 PM
Alessandro Zifiglio
your more than welcome, Mike :-)

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

Show quoteHide quote
"Mike Owen" <whatnospam@nospam.nospam> ha scritto nel messaggio
news:58267A3F-3A73-4ED3-ADB9-2EB14644EE59@microsoft.com...
> Thanks Alessandro.
>
> I was so close yet so far!
>
>
> Cheers, Mike.
>
> "Alessandro Zifiglio" wrote:
>
>> hi Mike, if your looking to break into a newline then just a carriage
>> return
>> wont suffice. along with \r issue a line feed also, so your expression
>> will
>> be \n\r for allowing a break into a newline.
>>
>> ValidationExpression="^[a-zA-Z0-9',.\n\r]+$"
>>
>> Regards,
>> Alessandro Zifiglio
>> http://www.AsyncUI.net
>>
>>
>> "Mike Owen" <whatnospam@nospam.nospam> ha scritto nel messaggio
>> news:FD2EFDA6-9DE9-43EB-93D1-EBABF8616420@microsoft.com...
>> > Hi,
>> >
>> > I am using a ValidationExpression="^[a-zA-Z0-9 '.,]+$" on a
>> > regularexpressionvalidator to restrict what is allowed to be entered in
>> > a
>> > MultiLine textbox.
>> >
>> > I would also like to allow the user to be able to enter a carriage
>> > return,
>> > enabling them to be able to break up the text they enter, but
>> > unfortunately
>> > despite all the additional bits that I have tried, e.g. adding \r
>> > between
>> > the
>> > 2 square boxes in the ValidationExpression, nothing seems to work.
>> >
>> > How would I change the expression above to allow a CR to be entered?
>> > (I
>> > have just thought should I be adding CR & LF not just a CR?).
>> >
>> >
>> > Thanks, Mike.
>>
>>
>>