633
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="../../WS/css/jquery-ui.css" type="text/css" rel="stylesheet" />
<link href="../../WS/css/validationEngine.jquery.css" type="text/css" rel="stylesheet" />
<script src="../../WS/js/jquery-1.8.2.min.js" type="text/javascript" ></script>
<script src="../../WS/js/jquery-ui.js" type="text/javascript" charset="utf-8" ></script>
<script src="../../js/readywsoffline.js" type="text/javascript" charset="utf-8" ></script>
<script src="../../WS/js/jquery.validationEngine-fa.js" type="text/javascript" charset="utf-8" ></script>
<script src="../../WS/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8" ></script>
</head>
<body>
<form action="" id="formID" name="formID" >
<input type="text" id="filename" class="validate[required]"/>
<script type="text/javascript">
$('#filename').keypress(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
alert("Enter");
var val = $("#filename").val();
if (val != '') {
var rev_str = val.split('').reverse().join('');
var char0 = rev_str.charAt(0);
var char1 = rev_str.charAt(1);
var char2 = rev_str.charAt(2);
var char3 = rev_str.charAt(3);
var sumchar = char0 + char1 + char2 + char3;
alert(sumchar);
if (sumchar != "txt.") {
if (sumchar != "TXT.") {
alert(sumchar + " " + "1");
$("#dialogmsg").dialog({
modal : true,
draggable : false,
resizable : false,
show : 'blind',
hide : 'blind',
width : 200,
dialogClass : 'osx',
buttons : {
" بازگشت " : function() {
$(this).dialog("close");
$("#filename").focus();
$("#filename").val("");
}
}
});
} else {
alert("salam1");
$("#formID").submit();
}
} else {
alert("salam2");
$("#formID").submit();
}
}
}
event.stopPropagation();
});
</script>
<button type="button" id="click">معتبر سازی</button>
</form>
<div id="dialogmsg" class="dialogmsg" title=" اخطار " style="display: none;"
align="center">
<span style="color: red;"> نوع فایل معتبر نیست </span>
</div>
</body>
</html>