We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to have an input field similar to SSN except it's the format of a TIN (XXX-XXXXXX).
Ideally I could pass to form.field a type="tin" and validations={['validTIN']}
form.field
type="tin"
validations={['validTIN']}
I can hide the value but the format is all numbers with dashes.
form.field("#tin", { type="text", maxLength: 9, inputMode: 'numeric', hideValue: true, });
I can mask the value but then the value doesn't get hidden.
form.field("#tin", { type="text", inputMode: 'numeric', hideValue: true, }).mask('999-999999', '*');
I could at least do this myself if hideValue: true worked when there is a mask.
hideValue: true
mask
Building a form that takes in TIN instead of SSN. It works with no dash but not as clear if the dash was present while inputing.
The text was updated successfully, but these errors were encountered:
Hi @emetcalf-leadventure unfortunately we don't have a native Tin field. I see your issue and as a quick solution - I can suggest using the SSN field with a mask Link to the demo: https://codesandbox.io/p/sandbox/collectjs-tin-field-show-hide-mask-6725f2?workspaceId=aa3ac769-4d1d-445c-afa9-29669766d966
Code example:
const form = VGSCollect.create("tnt53vgq99h", "sandbox", (state) => {}); const tin = form .field("#tin", { name: "tin", type: "ssn", validations: [ ... ], placeholder: "Taxpayer identification numbers", }) .mask({ mask: "999-999999", hideValue: false, }); let hidden = false; document.getElementById("show-hide-button").addEventListener("click", (e) => { e.preventDefault(); hidden = !hidden; tin.mask({ mask: "999-999999", hideValue: hidden, }); });
Sorry, something went wrong.
This is for TypeScript which has this issue that doesn't allow me to use mask as you are describing.
No branches or pull requests
Expected Behavior
I would like to have an input field similar to SSN except it's the format of a TIN (XXX-XXXXXX).
Ideally I could pass to
form.field
atype="tin"
andvalidations={['validTIN']}
Current Behavior
I can hide the value but the format is all numbers with dashes.
I can mask the value but then the value doesn't get hidden.
Possible Solution
I could at least do this myself if
hideValue: true
worked when there is amask
.Context
Building a form that takes in TIN instead of SSN. It works with no dash but not as clear if the dash was present while inputing.
The text was updated successfully, but these errors were encountered: