Hello,
You can referring to the fields’ values by their names “fieldname#”, only as part of the equations, but not in other contexts. So, you should insert a calculated field in the form, with the “Hide Field From Public Page” checkbox ticked (because this field would be used as auxiliary, and it is not relevant for the form’s interface), and enter as the equation associated to the field, the piece of code below:
(function(){jQuery('.image-container').css('max-width',fieldname77+'px');})()
If you need additional help implementing your project, I can offer you a custom coding service from my private website:
https://cff.dwbooster.com/customization
Best regards.
Wow, that works great! If I wanted to add dynamic height to it as well, could I do that in the same function or would I have to create a new function in a new hidden calculated field?
Hello,
Modifies all image’s settings in the same equation. For example, assuming that the field for the height is the fieldname123, the equation would be:
(function(){jQuery('.image-container').css({'max-width':fieldname77+'px', 'height':fieldname123+'px'});})()
Best regards.
That works – just one more question related to this:
How would I change the image size the same way? So instead of changing the image container I want to change the size of the image dynamically in the image container?
What I’m trying to do is allow the user to stretch the image horizontally and vertically based on their inputs (so the image doesn’t automatically scale but gets distorted). The function you have above doesn’t quite achieve what I am hoping to do.
Thanks so much – I’m learning with your help!
Hello,
You can insert the <img> tag with a class name to identify it with jQuery, and apply the CSS rules to the img tag.
Best regards.