Validate input type=file with onBlur

前端 未结 1 1018
悲哀的现实
悲哀的现实 2021-01-27 16:05

I\'m able to use onBlur to validate type=text or textarea inputs, however I haven\'t been able to get the same to work for type=file.

This works:



        
相关标签:
1条回答
  • 2021-01-27 16:15

    Try using the onchange-Event:

    <input type="file" name="file_upload" size="30" class="input" onchange="alert('Frell me dead, it works!');">
    

    Demo: http://jsfiddle.net/TimWolla/azvGP/

    0 讨论(0)
提交回复
热议问题