View Full Version : check file extension in a form

08-29-2005, 06:23 PM
So I have a form...
File: _______________ [Browse]
Name: _____________

when person chooses file by browse button I want submit button to disable when file has extension that is not .txt or .doc
how can I do that?

08-29-2005, 06:55 PM
Enter the text and blur<br />
Use your own method to call Ck()<br />
<input size="10" onblur="Ck(this);" />

<script language="JavaScript" type="text/javascript">
function Ck(obj){
if (val!='.txt'&&val!='.doc'){
alert(val+' is not .txt or .doc');
return false;

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum