Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
validation-regex issue for textarea in 5.5
jk8
Hello
I'm using TS 5.5.x on AIX 5.
Browser based templating.
Client machine is win XP.
Browser: IE 6.0
(1) Issue#1
I have a textarea item in the template. The requirement is that the character limit should be between 50 and 255 characters. When I try to save the dcr, it gives the following error message:
"Either there are fields that are required to be filled, or there are fields with invalid values. Please fix this before saving."
I have tried to save the dcr with the total number of characters in this field well within 50-255 character limit.
(2) Issue #2
Whenever I have the "$" in the regular expressions as shown below:
validation-regex="^[\s\S]\{50,255\}$"
it gives the following error:
"Templating Error Page
An exception was thrown: Error building the requirements: Stopping after fatal error: The value of attribute "validation-regex" must not contain the '<' character. "
If I escape the "$" by doing \$ or if I take out the "$"
validation-regex="^[\s\S]\{50,255\}\$"
it doesn't give the above error.
------------------------------------------------------------------
So far
I have tried following lines of code in datacapture.cfg:
<!-- 50 to 255 characters -->
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^[\d\w\s\D\W\S]{50,255}\$"></textarea>
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^[\d\w\s\D\W\S]{50,255}$"></textarea>
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^[\s\S]{50,255}\$"></textarea>
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^[\s\S]{50,255}\$" />
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^[\s\S]\{50,255\}\$" />
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^.{50,255}\$" />
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^.\{50,255\}\$" />
<textarea wrap="virtual" required="t" rows="20" cols="40" validation-regex="^.\{50,255\}$" />
Thanks
JK
Find more posts tagged with
Comments
jbonifaci
JK,
A few things first, you're never going to escape {, } or $ unless you are actually matching on that character. This is true for all special pattern match characters, like (, ), [, ], ?, ^, +, ., \, etc.
Secondly, I didn't see "^[\s\S]{50,255}$" in the list of regex you tried, if any of the \s\S combinations would work, it would be this one. If you're stuck on using \s and not \s (\S), try doing "^[\s^\s]{50,255}$" or "^(\s|^\s){50,255}$".
I know that "^(.|\n){50,255}$" will work, so if that doesn't work, you've got something else wrong.
The reason I would think you have something else wrong is your #2 issue, the '<'. There obviously isn't a '<' in any of the regex's you provided, that would would lead me to believe that you are missing or have a misplaced " in your DCT. If the above does not work and/or you are still seeing issue #2, check all of the quotes in your dct to make sure they are all opened and closed correctly. If you can't seem to find the bug, feel free to post your DCT and someone might be able to help you.
Hope this helps,
Jeff Bonifaci
ngogia
Need a little help here. This does not work. Though if you remove the validation-regex attribute from the item or make it "", the DCT opens up fine without any errors. This should mean that the datacapture is fine and has no unended quotes.
Also, the problem seems to be with "^" and "$", removing this also serves the purpose but then the regex is no more valid
How can we solve this?
Were you able to fix this particular problem?
RonaldV
Try 1 or 2 \-characters before the last $ sign. This has to do with escape characters in both perl & javascript.
Maybe Iwov should update their docs here and provide some helpfull (and working) examples.
Migrateduser
ngogia,
Can you be more clear on what you mean by "this"? The examples Jeff gives work fine in all versions of TeamSite that I have ever worked with (4.5 - 6.7).