What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How do I Insert the Name of an Uploaded File Into Another Field?

    Asked by Luxion on July 07, 2015 at 06:01 PM

    Hi, I've tried various way hinted at on the forum to get the filename of an uploaded file. The Form Calculation widget doesn't return a value and nothing else seems to work.

    What is the best way to get this info?

     

    Thanks.

    filename form calculation another field
  • Profile Image
    JotForm Support

    Answered by abajan on July 07, 2015 at 09:35 PM

    Please upload any file of your choice to this jotform and notice how the filename appears in the Name of uploaded file text box. Here's how this was achieved:

    1. After the Name of uploaded file field was added to the form, I created the following Update a form field value (see this screenshot) condition:


    2. (Optional step) After saving the condition, the Name of Uploaded file field was set to read-only by going into its properties and selecting Yes for Read-only as illustrated in the following example:


    That's pretty much all that was done to have the filename displayed in the text box. Cloning the demo form to your account and examining it may help to clarify the above but if you need further help with this, please inform us.

    Thanks

  • Profile Image
    JotForm Support

    Answered by abajan on July 07, 2015 at 09:48 PM

    This guide should be helpful. However, in this instance the Add Field button was clicked to insert the Upload a file "button" into the condition's work area:

  • Profile Image

    Answered by Luxion on July 08, 2015 at 11:09 AM

    Ok, thank you. I'm able to show it in the form, but how can you pass it along when the form is submitted? 

  • Profile Image

    Answered by Sammy on July 08, 2015 at 12:37 PM

    You can set the name to be outputted in a hidden field or a readonly field as directed by my colleague, by default all fields will be included in your submissions data.

     

    kindly let us know if you need further assistance or clarification

  • Profile Image

    Answered by Luxion on July 08, 2015 at 02:17 PM

    Ok, I see that it's working when I test it in JotForm. I am using the raw code on the site though, so it looks like I'm missing the proper script. What script do I need to call?

  • Profile Image

    Answered by Sammy on July 08, 2015 at 02:21 PM

    Since you are using the full code embed you will have to get a fresh copy of the code with the implemented changes.

    The full source code usually requires manual updating for the changes to reflect'

    Kindly let us know of the outcome

  • Profile Image

    Answered by Luxion on July 08, 2015 at 03:14 PM

    Ok, so we determined that it's three scripts being called, yes, in the full code embed. I did need to make some updates to the form, but once the script was added, the filename input is showing up. Thanks for your help.