I have this form:
<input type="file" name="CAR_Logo">
<button data-action="save" data-name="Africa">Save</>
How I can update my code to be able to upload the file ?
This is what I have tried:
$('[data-action="save"]').click(function(e) {
e.preventDefault();
CAR_Name = $(this).data('name');
CAR_Logo = $(this).val('CAR_Logo');
});
2
Answers
If you want to upload a file, you first need a web-based programming language that will run in the background. Javascript/Jquery codes are interpreted by users’ computers. What you need is a web server software and related software. For example, it can be php or python django, python flask or ruby on rails.
You can use AJAX
Your form
Your script