PDA

View Full Version : how to fire event after a file is selected with browse button



masipay
04-03-2010, 06:14 PM
I would like to validate the file type after a file is selected using browse button, is it possible?

I know this can be done using validation of the entire form with submit button however, is there a way to fire an event after a file is selected using browse button??

Thanks

jscheuer1
04-03-2010, 11:21 PM
Although, due to security restrictions, the file input is the most restricted of all HTML form elements, in limited testing it appears to still fire the onchange event:


<input type="file" onchange="alert(this.value)">

Unless you also need help with your validation routine, this should give you all you need to activate your code which determines the file type.