Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Allowing entry of a Carriage Return during data entry

Reply
Thread Tools

Allowing entry of a Carriage Return during data entry

 
 
Mike Owen
Guest
Posts: n/a
 
      07-27-2006
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.
 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      07-27-2006
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" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
 
Mike Owen
Guest
Posts: n/a
 
      07-27-2006
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" <(E-Mail Removed)> ha scritto nel messaggio
> news:(E-Mail Removed)...
> > 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.

>
>
>

 
Reply With Quote
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      07-27-2006
your more than welcome, Mike

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

"Mike Owen" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> ha scritto nel messaggio
>> news:(E-Mail Removed)...
>> > 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.

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ACL entry allowing tracert and traceroute aleu@vp.pl Cisco 7 12-04-2008 04:29 AM
Carriage Return added during return of large string from class method Xeno Campanoli Ruby 0 02-13-2006 08:39 PM
RegularExpressionValidator allowing no entry tshad ASP .Net 3 03-04-2005 11:57 PM
Help: Delete a single carriage return in a file, but not a double carriage return? Steve Anderson Perl Misc 3 06-21-2004 12:48 AM
Postback after carriage return input Ferdi ASP .Net 5 08-24-2003 07:12 AM



Advertisments