$(function () { $('form').submit(function () { var selectedFile = $('#file').val(); var matches = selectedFile.match(/\.(xlsx?)$/i); if (matches == null) { alert('please select an Excel file'); return false; } return true; }); });
<input name="Datei" type="file" size="50" maxlength="100000" accept="text/*">
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)