Dear @Qman,
It would be best to use a regular text field instead as Number fields only accept numeric values. You can specify acceptable patterns for the text fields, more on that here - Single-line Text field — Public web forms
I think the pattern window is only available for PlumSail Online. I only have access to the program so I would need to code the Regex. Can you provide me with the code? That would be most helpful. My programming skills are not the best!
Dear @Qman,
We can help you with programming, but we need to know which version you're working with. Can you send me a screenshot from the editor, where the field is selected and the version number is visible?
Dear @Qman,
My bad, you're actually right - this is only available for common fields. What you can do - add SharePoint field to the form and hide it using Style property: display:none;
Then you can add a Common Single-line Text field with a pattern that you need, e.g. : ^([0-9]-?){8}$
Or you can add a Common Masked Input field with a mask that you need, for example : ########
Which you can then use to populate SharePoint field, the code would look like this:
fd.spRendered(function(){
//update common field on form load
fd.field('MaskedInput1').value = fd.field('Title').value;
//update sharepoint field on common field change
fd.field('MaskedInput1').$on('change',function(value){
fd.field('Title').value = value;
});
});
Field names are given only as examples, use the correct ones for you.
Dear @Qman,
Yes, it will - it will copy the value with JavaScript and save it inside of a SharePoint field, and then retrieve the data from this SharePoint field, and set it inside of the common field on load.
SharePoint field will actually do the storing, and it will be hidden from a user.
Dear @Qman,
The SharePoint field will only do the storing, so you don't want users to be able to see and edit it - instead, they would use the Common field that you place, and it would automatically copy its value inside of the hidden field.
This is how it would look like if you don't hide the SharePoint field:
In this case, it would be best to hide Title field so the process is working behind the scene.
I also wanted to ask, is there a way to make this field more dynamic?
In my organisation, an assignment number must be 8 digits BUT there are some people who have extra assignments.
Scenario:
Person 1: 12345678
Person 2: 12345678-12
If Person 1 fills out the Masked Input field with their number, I don't want any hyphen to appear.
If Person 2 fills out the Masked Input field with their number, I want a hyphen to appear automatically.
Right now, my Masked Input field shows the hyphen which may confuse the user as they'll think they need a number after the hyphen/dash.
Dear @Qman,
You can change field's mask dynamically with JavaScript, you just need to make sure that you check for user type 1 or 2, and then modify the mask accordingly - Masked Input field — Public web forms
Dear @Qman,
Nothing is impossible, but it would require much more code than the solution provided. It's not supported out of the box.
Of course, if you're interested in adding new features to SharePoint fields, we can always offer paid support to add new properties to fields. Contact us with the requirements at [email protected] to get an evaluation.