1

i am trying to use angular ui.mask module to display a full length url based on user entering a section name(suffix)

http://www.example.com/XYZ where 'XYZ' is the user input.

While a mask 'http://www.example.com/AAA' works fine, it does limit the user to entering only 3 character. Any quick ways to extend the length accepted?

I tried altering the regex to accept variable length, but haven't got this working. Any help would be appreciated.

Thanks.

2
  • The ui.mask module was designed to work with inputs that require a pre-defined length. I don't see a way of using it to do what you need. Commented Sep 26, 2014 at 9:38
  • ui.mask usage was an overkill anyways for the simple concatenated display that i needed in my case. ( what was i thinking ! ) i added span and just displayed the concatenated string. Commented Oct 19, 2014 at 18:34

1 Answer 1

1

This can be accomplished by using a question mark before any character in the mask that would be optional.

In your case, it would look like:

ui-mask='http://www.example.com/?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A?A'

Better late than never...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.