Answer the question
In order to leave comments, you need to log in
How to add pictures in laravel?
Not strong in laravel, so such a question?)
I copied the view from another file
There is a view
<script>
$(function () {
$("#uploadBtn").change(function () {
$('#fn').html($('#uploadBtn').val());
});
});
$(document).on('click', '.sub-data', function () {
var dis = document.getElementById('upload_for');
var uploadBtn = document.getElementById('uploadBtn');
var msg = document.getElementById('msg');
if (dis.value == "") {
msg.innerHTML = "Please Select Employee for Display.";
dis.focus();
} else if (uploadBtn.value == "") {
msg.innerHTML = "Please Select File for Upload.";
uploadBtn.focus();
} else {
msg.innerHTML = "";
document.frmAddFile.submit();
}
});
</script>
<td>
<div class="fileUpload btn btn-success" style="width: 130px; margin-left: 1px;">
<span>Upload File</span>
<input id="uploadBtn" type="file" value="" required="true" name="custImage" class="upload"/>
</div>
</td>
<button type="button" class="btn btn-outline sub-data">Save changes</button>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question