I have a form which takes a couple of text field inputs and then a folder path. Now before I submit the form I want to make sure that whatever the folder path the user specified is correct, if not print an error message.
Is there a way I can validate this in the same page before I submit the form?
I used javascript, but it doesnt seem to work as I expected. Thoughts/Suggestions ?
<script>
function checkfolder()
{
var myObject;
myObject = new ActiveXObject("Scripting.FileSystemObject");
if(!myObject.FolderExists()){
alert("Folder does not exist");
}
}
</script>
<form method=post action="some_file.php">
.
.
.
<input type="submit" name="submit" value="submit" onClick='checkFolder()'>
</form>