You are viewing limited content. For full access, please sign in.

Question

Question

Need help with code for a required custom HTML field

asked on January 23

I am trying to build a custom HTML input box for capturing SSN.  The reason is because I can set the input type="password" and then it will obscure the information as the user enters it.

 

However, I need this to be a required field on the form.  Having difficulty figuring out how to accomplish this via CSS and JS that uses whatever Laserfiche has already built into the "Submit" button.  

 

Has anyone been able to make a custom HTML element a required field?  Thanks.

0 0

Replies

replied on January 26

You won't be able to get the value of an input field in custom html to use it anywhere but it being visible in the form itself. I would just use JS and CSS to hide the field and replace it with custom html when the user is done filling that field. Something like:

1. onFieldBlur -> changeFieldSettings -> set text above or below to html <span>SSN hidden</span><button onclick="editSSN()">edit</button>

2. define editSSN on the window and undo the hiding of the field when edit is clicked. on blur will hide it again.

 

To answer the original question though, you can use onFormSubmission to do any custom validation you want even with custom html. In your case there isn't anything available to validate though.

1 0
replied on January 29

I found this post to be quite helpful. 

https://answers.laserfiche.com/questions/199019/Replace-Digits-with-Asterisks-In-Forms#200050

This would allow you to do it without custom html fields smiley

1 0
replied on January 26

Thanks, Zachary.  I think I was beginning to come to this conclusion after testing a variety of options last week.  

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.