Here is my Fiddle
What i have is to display the image name near the upload text in the onchange event.
Here i need to have the validation on the onchange and it should display the error along with the file name
Here is what i have tried.
Upload<input type="file" onchange=" document.getElementById('spanFileName').innerHTML = this.value;" style="display:block;margin-top: -20px;opacity: 0;" >
Note :
I don't want to do the validation in a seperate by setting rules, i want to do it in onchange, but it will be ok if i have the script inside the input type file code
Update : It will be better if i have the file name to be displayed and hide in 5 seconds, as i don't know to write script inside the input type file code
How can i do this, Help please
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…