I have input fields for IP address in a form, and I used the IP Address mask provided by CF. I see the mask as I expect:
[attachment=0]IPMask.png[/attachment]
However, it only accepts 5 digits: 3 in the first field, 2 in the second. I set the length and the max length to 20 but that didn't help.
So I tried a custom mask instead:
[attachment=1]customMask.png[/attachment]
But that INSISTS on 12 numbers and the numerals keep moving left to fill in. What I mean is: If I want to enter '128.92.76.2' and move the cursor into the next field, I get '128.92_.76_.2__' So if I delete the '_', the numerals move left and I have '128.927.62_.__'
How can I get this to accept a valid IP address format?
[attachment=0]IPMask.png[/attachment]
However, it only accepts 5 digits: 3 in the first field, 2 in the second. I set the length and the max length to 20 but that didn't help.
So I tried a custom mask instead:
[attachment=1]customMask.png[/attachment]
But that INSISTS on 12 numbers and the numerals keep moving left to fill in. What I mean is: If I want to enter '128.92.76.2' and move the cursor into the next field, I get '128.92_.76_.2__' So if I delete the '_', the numerals move left and I have '128.927.62_.__'
How can I get this to accept a valid IP address format?
Found a suitable answer: I changed the mask to be
data-inputmask='mask' : '9[9][9].9[9][9].9[9][9].9[9][9]', 'greedy' : false
so only the first number is required; the 2nd and 3rd in each field are optional and the space for them only appears if the user types them in. So there are no '_' left in the IP address.
I still don't know why the built in IP Address mask only allows me 5 digits. Anyone out there have an idea??
data-inputmask='mask' : '9[9][9].9[9][9].9[9][9].9[9][9]', 'greedy' : false
so only the first number is required; the 2nd and 3rd in each field are optional and the space for them only appears if the user types them in. So there are no '_' left in the IP address.
I still don't know why the built in IP Address mask only allows me 5 digits. Anyone out there have an idea??
This topic is locked and no more replies can be posted.