How to prepopulating height and width from uploaded content.

  • Profile Image
    torreszach
    Asked on December 14, 2016 at 04:13 PM

    Hello,

    So I have a form where users can upload an image with the "Image Upload Preview" widget. I was wondering if I could prepopulate two fields, width and height, into another form using the method listed in this forum: https://www.jotform.com/help/351-How-to-Automatically-Pass-Form-Data-to-Another-Form or any method for that same reason.

    I understand that when I inspect the code on the site it is in HTML and the dimensions I require are Computed CSS. I just want to know if there is a method to minimize user error on my form.

    Below is the form in question

    Thank you,


    Zach

  • Profile Image
    jonathan
    Answered on December 14, 2016 at 06:42 PM

    Hi Zach,

    If I understand correctly what you are after on your form https://form.jotform.com/63447440386157, you want to use the dimensions data  from the form and use it to prefill another form field.

     

    I checked the length and width fields and I see they were just spinner field.

    So you can actually use the data from them to populate another form field using the method described on the user guide:

    How-to-Automatically-Pass-Form-Data-to-Another-Form

    Hope this help. Let us know how we can be of further assistance.

    Regards

     

     

  • Profile Image
    torreszach
    Answered on December 14, 2016 at 07:38 PM

    Not quite.

    I've included new forms to better illustrate my question.

    Form 1: https://form.jotform.com/63487760462161

    Form 2: https://form.jotform.com/63487168696172

     

    What I want to accomplish: Prepopulate From 2's length and width fields with the USER upload picture from Form 1 via the "Image Upload Preview" widget.

    1. A user uploads their picture from their computer in Form 1.

    2. User hits submit and is re-directed to an external link (Form 2), instead of a thank you page.

    3. Form 2 now has prepopulated fields (length and width) based on the user uploaded image in Form 1.

    Why I think this is possibly: With jotforms, to prepopulate fields onto other forms (Form 1 to 2 for example), we pull from the HTML code. Instead of pulling code from the html code, I want to pull code from the Computed CSS code.


    Thanks

  • Profile Image
    torreszach
    Answered on December 14, 2016 at 07:49 PM

  • Profile Image
    jonathan
    Answered on December 14, 2016 at 09:13 PM

    Thank you for providing clearer details of what was needed. But I think that is not possible to achieve using the Form Builder at this time.

    It is because the dimension data of the uploaded file via upload widget is not an input data/field. Those are just static numbers and there is no means for the form script functions to interact with them.

    It will be simpler if you will just instead use a separate fields for those dimensions. Similar to my initial understanding (previous response).

    If you have those dimensions on an existing field on the 1st form, you can easily pass them to the fields on the 2nd form.

    --

    Another option is by using the form's full source code and influence the behavior of the dimension data using your own custom injected javascript codes (but this can be very complex and may require a programmer to code it)

    Please let us know how we can be of further assistance.

    Regards