• Resolved dako77

    (@dako77)


    Hello,
    I would like to change value of one of fields by clicking at href ?? When I click at image or text – it will preddefined value of one or more field ??

    how is this possible ??

    Thanks ??

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

    (@codepeople)

    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 ??

    Plugin Author codepeople

    (@codepeople)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change value by clicking at picture’ is closed to new replies.