Text Field, validation pattern

Web site stuff is not my day job. I was tossed this project, so please bear with me.
I need to have a text box to allow a user to enter in a IPv4 address. I wanted to have some formatting and have spent hours googling and trying all sorts of things. Tried many variations of “Validation Pattern” with no affect at all. Like

pattern="^([0-9]{1,3}.){3}[0-9]{1,3}$">

and many others but with no affect at all on what I type in the field box.

Looking into other avenues, I found this DEMO and it does exactly what I want.
I imported the .js files and mimicked the text field parameters but sadly still no affect like his demo.
Would someone be wiling to shed some light on what I can do to get this working right?

Looking at the demo source code you are missing ip-mask from your input.

I assume your app.js contains
$(document).ready(function(){ $('[ip-mask]').ipAddress(); });

Thank you, I have no way to add that (that I know of). It wont let me edit the html to add options that are not in the “options” tab for the Text Input field.

Yes, my app.js has this in it. I downloaded his project and imported his 3 .js files, so there are no typos.
After unziping his demo I ran his index.html file and it does work fine.

I cannot put app.js after mask.ip-input.js. When I add them it automatically puts these 3 .js files in alphabetical order.

Go to the attributes panel and type in the key and hit enter.

Thank you so much!!! Its works as it should now.

You’re welcome :slightly_smiling_face:

1 Like