horseatingweeds Posted July 20, 2007 Share Posted July 20, 2007 I'm writing a script to check several form elements, several of them are file inputs. I've found that only the first file element with contents will be checked, the rest are ignored as is the script written to check them. Is this something inherent in file fields? Here's the page if you want to take a look: http://www.gentledoberman.com/test-input.php Do I need to put each file input in a separate form perhaps? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted July 20, 2007 Share Posted July 20, 2007 In your input_formCheck.js: // ... }else if (form.fileImg1.value.length > 0){ alert(''); }else{ returnValue = true; } Perhaps if you actually checked the values of form.fileImg2.value.length and form.fileImg3.value.length you could validate them. Also, I noticed you're looking at file extensions to determine MIME type; that's considered bad practice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.