Hello @dako77,
Honestly I don’t understand your question. If there is an image in your form and you want change the value of a field when the image is clicked, first, assign a class name to the image, for example: my-image, and then, you can insert a “HTML Content” field in the form, with a piece of code similar to the following one as its content to assign the value to a field in the form, for example, to the fieldname1 field:
<script>
jQuery(document).on('click', '.my-image', function(){jQuery('[id*="fieldname1_"]').val(123).change();});
</script>
and that’s all.
Best regards.
Thread Starter
dako77
(@dako77)
Yeah thats it π Thank you π It helps me.
Is there nicer way how to write this code if I want work with 5 images and I want edit 2 fields once? π
If not, is not problem.
By the way this is big help for me π
Hello @dako77,
The plugin can be extended as you want, and of course, if you need specific behaviors, you need to enter your own code.
An alternative would be duplicate the code for every image, using the corresponding image’s class name, the fields’ names and the values to assign, but there are multiples alternatives.
Best regards.