CalcBuilder Forum

Input mask to add prefix?

User TheFencepedia 2025-09-25 18:20:40

Hi there,

I want to automatically add the prefix Q to an alphanumeric added in a form field. However, it does not have to be a money, a phone number etc.

I just need it to be Q0001 or whatever it is that they enter.

How do I do that? When I click the "More Information" button on that field, it does nothing, so I thought I would ask directly.

Thanks.

Moonsoft support 2025-09-26 10:58:54

Hi,
right, the link for the additional info is no longer working, it'll be fixed for next release, thanks for pointing that out. For your case, the configuration you need is:
- Input Mask: Select predefined or enter custom mask - > AAAAAAA (enter as many 'As' as characters you want to allow)
- Mask prefix : Q

Hope this helps, regards
Silvia Martín
Moonsoft Team

User TheFencepedia 2025-12-04 03:47:05

Hi,

This is not working. I input the details as outlined above, but it does not save the prefix, and it does not apply it.

Is this one of the "minor fixes" you made? Because I had to modify the code to make a custom plugin work, and I'd rather not have to update if I don't have to.

Moonsoft support 2025-12-04 08:52:58

Hi,
the prefix and mask have not suffered changes at least at recent versions, but we can't be sure if you have a very old version, or a modified one, we have tried the suggested solution here with latest release and it works as expected.

As a first step, if you are not able to save data configuration from your backend, the problem may be in any security rule or script not loading properly. Please look for any error at that page using the browser, it can give you any clue about the origin of the problem. If you're not able to find out, you can also share an access at the ticket 'private data' section and we'll give a quick look to let you know if it's a third-party problem or if you will need to upgrade.

Best regards
Silvia Martín
Moonsoft Team

User TheFencepedia 2025-12-04 16:24:44

Hi,

I don't think the customizations would make a difference, and it's only two versions old. I was intending to backup and attempt to upgrade and just re-modify the code, but if I can put that off for a while, that would be better.

I have shared login information.

Please don't change anything without telling me!

Moonsoft support 2025-12-05 09:08:51

Hi,
that user provided is not working from here, sorry, can you please recheck the access? Please also share the calculator, field and page where you're trying to configure that input mask so we can check your configuration..
Thanks, regards
Silvia Martín
Moonsoft Team

User TheFencepedia 2025-12-05 16:58:42

Sorry! I hadn't enabled it.

It should work now.

You can test it on calculator ID 386, which is on the front end here: https://www.drawafence.com/forms/project-management-forms/change-order-request

You should be able to skip setting up a company and logo. If you leave it blank it should still work.

User TheFencepedia 2025-12-07 07:00:25

Hi again,

I suspect you will only see this after the weekend, but I wanted to show you that it's not ONLY the prefixes that aren't working.

It's also some other random input masks that don't work.

I made a video.

https://1drv.ms/v/c/80b09a14952e9490/IQDMKaVS8W6ITaUy_tcbTIt_AYj99raOyK_ReKfcD8i4DgY?e=tuYSpO

The only thing I can think of is maybe I need to change a PHP setting? If so, which one?

User TheFencepedia 2025-12-08 04:00:39

While you are in there, can you check why numbers that have no entry are giving a zero on the frontend?

This form: https://www.drawafence.com/forms/production-forms/production-report which is calculator 391 should give you blank results if you don't fill in the Quantity Type field on the form, but it gives a zero.

I tried putting a space in the default value, but that didn't work.

Moonsoft support 2025-12-08 10:02:03

Hi,
we suspect not all fields present at the configuration page are being handled by the server, so they are not stored at the database, because that page sends a big name of configuration parameters. Please try to increase your server php setting
max_input_vars to a big number, for ex 10000, and then try again to save the configuration.

Regarding your other question, the number field will always give you a number (0 if left blank). This happens because previous versions of php allowed to handle an empty text inside math operations, you could send an empty text, multiply by 3 and it didn't launched any error. With the new version of php these kind of operatoins make the execution crash, so hundreds of calculators were going to be in error with the upgrade, that's why numbers are always converted before calculations.

If you specifically need a form field able to send text or number, then you need to set it as text, and limit the characters allowed using the input mask. We suggest to try first to solve the configuration issues increasing the setting and then configure the mask for this case, let us know if you need help to do it.

Best regards
Guillermo V.
Moonsoft Team

User TheFencepedia 2025-12-09 16:38:52

Hi,

I tried this. Increased it to 100,000.

Didn't help.

What else can I try?

Moonsoft support 2025-12-10 10:09:45

Hi,
perfect, that value is now big enough to handle all forms and data. You have 2 different problems with the settings:

The mask ,that is being saved, but sometimes is not applied.

This happens because you have set a field type incompatible with the mask you want to apply. For ex, the 'requester phone' field from site instruction calculator (ID=390), has a 'number' type, but you want to apply a mask that contains some other charaters ( or -, so you need to set this field as 'text'. Then you should see the mask being applied to the front page, and the 'mask' configuration field will open for you to introduce any custom mask, or use one of the pre-configured from the set (while from other types it remains disabled/grey)

The 'prefix' configuration field, that is not even saved, so it's not applied.

Looking back some versions, we found one update coming from an older release (5.1.1) that affects specifically this field, and also the db structure. We assume your custom version is based on a more recent version, but it's worth checking if the problem is that update was not properly launched and you don't have those changes at the database. Are you able to confirm if you have the fields 'prefix' and 'suffix' present at your db table

PREFIX_calcbuilder_field

?
Let us know if you need our help to check this.

Thanks, regards
Guillermo V.
Moonsoft Team

User TheFencepedia 2025-12-11 18:27:59

Hi,

I am running 5.5.5. So a lot older than the version you are talking about.

I don't see either prefix or suffix in the DB tables.

User TheFencepedia 2025-12-11 18:28:28

Sorry, a lot NEWER.

Still not working though.

User TheFencepedia 2025-12-11 19:52:08

Hi again,

I made a video for you: https://1drv.ms/v/c/80b09a14952e9490/IQD2ir91vShoQIHYQnGRkIUjAfwJ6NbVGYvD0_Wl7QV93mM?e=WmB9l1

Moonsoft support 2025-12-12 11:36:48

Hi,
ok, even if your version is newer, at your database we couldn't find the fields to store prefix/suffix configuration inside calcbuilder_field table. So maybe the update to pass to version 5.1.1 didn't complete properly, was not launched using the package installer, or there was an error upgrading database at that time. However, you do have a new field that was added later for version 5.2. We have managed to launch only that part of the missing upgrade at your site, so now you have all fields at the table (please see screenshot attached).

The prefix/suffix is now stored so it works as expected, we tried the field at change-order-request form (386). The rest of the mask options will also work as commented above if you switch the field type to a text type to allow the special characters.

Please give it a try and let us know if you can find any other issue.

Thanks, regards
Guillermo V.
Moonsoft Team

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!