submitting form on image click

后端 未结 4 919
無奈伤痛
無奈伤痛 2021-01-12 12:50

I have multiple images inside one form. Depending on the image clicked a specific value should be sent with a POST.

Can this be done without javascript? (I use jquer

4条回答
  •  轮回少年
    2021-01-12 13:22

    Using jQuery you can submit the clicking on the image. You can add a id for the image or even a classe.

    $( "#yourImageId" ).click(function() {
      $( "#yourFormId" ).submit();
    });
    

提交回复
热议问题