I have a modal that displays various images.
I also have a form with 5 text type inputs. How do I get when clicking on an image to fill the url correct in active input?
all image tags are as follows:
<img data-dismiss="modal" class="img-responsive" src="nameImage.png"/>
Currently I can only fill a single input
$('img').click(function(){
$('#url_image').val($(this).attr('src'));
})
Form:
<form method="post">
<button data-toggle="modal" data-target=".bs-example-modal-lg">Show images</button>
<input type="text" id="url_image" name="url_image" value="">
<input type="text">
<input type="text">
<input type="text">
<input type="text">
<input type="submit">
</form>