I need to recover the value of an image and insert in an input file with item_photo id

Asked

Viewed 18 times

0

I’m a beginner in programming and I’m in a big dilemma, maybe it’s easy for some but I’ve been trying for days and I can’t.

$('.crop_image').click(function(event) {
      $image_crop.croppie('result', {
        type: 'canvas',
        size: 'viewport'
      }).then(function(response) {

            $('#insertimageModal').modal('hide');
            $('#img').attr('src', response)

            var img = document.getElementById('img')
            //$('#item_foto').attr('name', response)
        
      });
    });

The input file already exists in the code. I am trying to recover the value of an image that was croppied and pass the value to the input file. When I click save the image is being sent in original size.

  • I explained better what you’re trying to do?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.