Copy link to clipboard
Copied
Hello everyone. I have created a pdf form, and i needed a button for the user to attach files to it (it is an application form). Got the javascript for it and it works fine BUT you can click and upload as many files you want (i wish i could limit the button to 1 attached file) and i can't get the field to be required. As it is an application form, i need all fields to be required, including the attach your file field. In short: i need a button that attaches the person's file (like hers/his resume for example) and also be a required field, meaning, if there is no attachment, the form can not be sent. Anyone with an idea to help me? This is what I have been trying for the last four hours and got nowhere:
1- tried to create a text button that can be set as required, but even though the script works, form doesnt understand that the button doesnt need to be filled with text, so it blocks the form to be sent because it understands it is an empty field.
2- tried to create a required field checkbox and link it with the field so when file is attached, checkbox is filled and ready to go - no success... maybe this could be a way but i have no idea how to execute it the proper way
3- tried to use the regular button like it is supposed to be and add a script for making it required but couldnt find a script that works...
Don't know what else to do... so please... help!!
Copy link to clipboard
Copied
A button isn't a type of field that can have a value, so it won't work. A check box (and radio button group) has a non-blank value whether it's selected (export value) or not ("Off"), so it won't work. In the script that you use to prompt the user to select a file, you could set the value of a text field to something other than blank, and also make it required, and that would work.
Copy link to clipboard
Copied
Thank you for your response. But i can't make it a text field, because there is nothing to be filled as text in that button and because there is nothing to be field than the form doesnt let the person submit it. I have tried it... Would you like to take a look at the form?
And so you know, and maybe have a better solution, the idea is to block it somehow, from being sent without all the attached files required. (there are around 6 buttons "attach a file" in the form. My other idea, since I cannot make it a required field, is to have a checkbox that turns "checked" if the file is attached. and i can make the checkbox required, so if the user didn't attach the file, form cannot be submitted. When he attaches all the files, all checkboxes turn "checked" and they can submit the form. What do you think? I am totally opened to other ideas. Thanks again!
Copy link to clipboard
Copied
++Adding to the discussion,
Would you mind sharing the code you're using, and possibly the file (or an example of this file)?
Copy link to clipboard
Copied
thank you!
sure, here is the link for the form
Copy link to clipboard
Copied
Ls_rbls could you take a look into the form??
Copy link to clipboard
Copied
Yes, wil do.
Copy link to clipboard
Copied
You cannot control the presence of an attachment by making a field required, whatever its type.
Clicking on a button does not mean anything, the user can then cancel the action or delete the attachment he has just added.
You must use a JavaScript code that checks for the presence of an attachment.
Copy link to clipboard
Copied
Thank you for your response.
Let me explain it better: I did find a javascript code that "attach the file" to the form. Now, since it is an application form, I would like to block it somehow, from being sent without all the attached files required. (there are around 6 buttons "attach a file" in the form. My other idea, since I cannot make it a required field, is to have a checkbox that turns "checked" if the file was attached. and the checkbox is required, so if the user didn't attach the file, form cannot be submitted. What do you think? I am totally opened to other ideas. Thanks again!
Copy link to clipboard
Copied
just an update - I am a designer, so I know absolutely nothing about javascript, but i am very hopeful there will be someone eles out in this world that tried to make an application form on a pdf form and run into all this... Find me and help me , oh lord of the application forms!!