• Resolved rui9075918

    (@rui9075918)


    It is possible to manipulate the preview of an imported file, in the case that interests me are image files. For example, through the number field, change the size of the preview. Or, by selecting checkboxes, change the type of border. Or somehow access the image in an html field.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @rui9075918

    Thank you very much for using our plugin.

    The selector for the images previews is:

    #fbuilder .cff-file-field .files-list img

    So, If you want to increase the size of image previou and border, you can enter the style definition below through the “Customize Form Design” attribute in the “Form Settings” tab:

    #fbuilder .cff-file-field .files-list img{
    width:300px !important;
    border: 2px solid blue !important;
    }

    Best regards.

    Thread Starter rui9075918

    (@rui9075918)

    Thanks for the quick response. It already helps me a lot. But I would like to know if changing a number field, or another, could manipulate the dimensions of the image. Thanks again.

    Plugin Author codepeople

    (@codepeople)

    Hello @rui9075918

    If you know the images selector, you can vary their appearance at the runtime by coding.

    For example, assuming you have the number field fieldname123, you can insert a calculated field in the form and enter the equation:

    (function(){
        var css = {};
        if(fieldname123 < 10) { 
            css['borderColor'] = 'red'; 
            css['width'] = '100px';
        } else {
            css['borderColor'] = 'green'; 
            css['width'] = '200px';
        }
        jQuery('#fbuilder .cff-file-field .files-list img').each(function(){jQuery(this).css(css);});
    })()

    The previous equation varies the images sizes and borders colors at the runtime based on the value of the fieldname123 field.

    Best regards.

    Thread Starter rui9075918

    (@rui9075918)

    Thanks so much for your help. Congratulations on the quick and effective way you answered the questions I asked.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Upload files “images”’ is closed to new replies.