|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Allowing entry of a Carriage Return during data entryHi,
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. 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. 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. > > > 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. >> >> >>
Stopping Attributes.Add from converting my JavaScript event code to HTML
disable an ascx entirely in my web page GridViewRow FindControl failing GridView ScrollBar Stop Postback in image button Page with User control loads twice. sumbit server form to another page Rename ID in Properties Window Crystal report in VS 2005 Professional Treenode |
|||||||||||||||||||||||