12th Sep 2020, 9:56 AM
Papa Penguin
10 ответов
+ 5
window.onload=function(){ var form=document.getElementById("form") form.addEventListener("submit", function(event){ event.preventDefault() var reader = new fileReader() ; var name=document.getElementById("image").files[0].name console.log(name); }); }
12th Sep 2020, 10:05 AM
Divya Mohan
Divya Mohan - avatar
12th Sep 2020, 9:58 AM
Papa Penguin
+ 3
Divya Mohan But it is saying form is not defined
12th Sep 2020, 9:59 AM
Papa Penguin
+ 3
Your firm is not a global variable. It is defined in window. On load function which you have just close in line 4
12th Sep 2020, 10:02 AM
Divya Mohan
Divya Mohan - avatar
+ 3
Divya Mohan Do what can I do
12th Sep 2020, 10:03 AM
Papa Penguin
+ 2
Input type file not pop up option here in solo learn to upload files due to safety reason. I had also tried it once.
12th Sep 2020, 9:58 AM
Divya Mohan
Divya Mohan - avatar
+ 1
In html close form tag <> in L ne 10 and div tag <> which is in line 9 And define fileReader() in js
14th Sep 2020, 9:56 AM
Mr. Dark
Mr. Dark - avatar
- 1
hooa
14th Sep 2020, 7:00 AM
Gaytan Emilio
Gaytan Emilio - avatar