Hello,
If your problem is to make the file browser showing only image files when
clicking on browse, you've to use the "accept" parameter for the field,
i.e:
<input type="file" class="validate['required','image'] text-input" name="file"
accept="image/*" />
But I think it doesn't work on all browsers...
Else, I don't understand your problem, this should work, when user try to upload something else than a file with jpg, jpeg, png, gif or bmp an error message is displayed.
The image field check is based on a regexp (default is "/.(jpg|jpeg|png|gif|bmp)$/i" allowing only jpg,jpeg,png,gif, and bmp) that you can modify when you initialize the script.
i.e :
window.addEvent('domready', function(){check = new FormCheck('
name of you form', {
display : {
You display options here... }
regexp : {
image :
you custom regex here... }
})});
If the extension of the file selected within the file field doesn't match the regexp an error message is displayed saying "This field should only contain image types".
Hope it helps! ;)
Best regards,
Jean-Marc