You are here: irt.org | FAQ | JavaScript | Form | Q1698 [ previous next ]
Try:
<html> <head> <script language="JavaScript"><!-- function getExtension(value) { return value.substring(value.lastIndexOf('.') + 1,value.length); } //--></script> </head> <body> <form> <input name="myFile" type="file"> <input type="button" value="Extract" onClick="alert(getExtension(this.form.myFile.value))"> </form> </body> </html>