Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorkbrande1
    • CommentTimeApr 8th 2010
     
    Upon searching the forums, this was the only thing I found that seemed to apply to my situation:

    http://www3.formassembly.com/forum/discussion/450/can-i-limit-character-length-ensure-no-spaces/

    I applied one of the rexex expressions you suggested there (this one: ([A-z,0-9]){20} ) but it didn't work. I am no regex expert, but I have just been reading up on it for a couple hours and I think your syntax may be incorrect. I think it should have been this instead(?):

    [A-z0-9]{0,20}

    or maybe even(?):

    ^[A-z0-9]{0,20}$

    But that doesn't work either. Actually, I have also tried to do all of the following, to no avail:

    {20}
    .{0,20}
    ^{0,20}$
    ^[.]{0,20}
    /^.{0,20}$/
    ^[.]{0,20}$
    ^.{0,20}$
    [.]{0,20}
    [.]{,20}

    -What is running the validation? PHP or JavaScript? Does it matter (I read that regex syntax may be different)?
    -Are the ^ at beginning and $ at end required?
    -Is the dot (.) wildcard recognized in this implementation of regex (again, depending on what is doing it, I read that it may or may not be recognized)?
    -Or I completely barking up the wrong tree? I may know just enough about this to be dangerous. lol

    What I am trying to do is limit the field length to 20 characters (any character). I will be importing the data into my accounting software and that is the limit for this field. I figured better to catch it while filling out the form and get an error message than to have some characters chopped off somewhere later during the import process.

    Well, I give up (for now). :) Any ideas?
    • CommentAuthordbuschho
    • CommentTimeApr 8th 2010
     
    Hem ... did you try:
    ^.{0,20}$
    or
    ^[A-z,0-9]{0,20}$

    Both seem to work on the firefox console ... but I could be wrong. Could you setup a failing example of what you want and show us the url?


    Happy to help,
    FA Support.
  1.  
    Hi,

    I tried
    ^[A-z,0-9]{0,255}$
    for some text fields that are mapped to fields in Salesforce that have a 255 character limit. When testing the form it acts as though I've gone over the limit even if I've only entered one character. I tested the from in IE and Chrome.

    Any other ideas?
    thanks
    •  
      CommentAuthorcedsav
    • CommentTimeJun 4th 2010
     
    ^[A-z,0-9]{0,255}$ should work.

    Here's an example (first field limited to 10 characters). I just tested it in Firefox, IE8 and Chrome.
    http://www.tfaforms.com/19536

    You can open it in the Form Builder with this link:
    http://app.formassembly.com/forms/edit/builder/19536/1

    Make sure you don't have any space in your expression. Open a support request with a link to your form if you want me to take a closer look.
  2.  
    Hi,

    I'm realizing now that it did work when I entered one character (or one word) in the field, but didn't work when there were any spaces in the text. I should have more paid attention when testing. Your example has the same limitation with the space character. I've changed mine to "^.{0,255}$" now. It works with the space character in the response text. That should take care of it.

    Thanks for the help,
    Les
  3.  
    I am getting an error using ^[A-z,0-9]{0,255}$ and I believe it is because the applicants are using / and other characters not a number or alpha. How do I account for that?
    • CommentAuthordbuschho
    • CommentTimeOct 7th 2010
     
    Hello,

    Try
    ^(.){0,255}$
    as in the last comment on the thread. I think it should work.