Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only msgValidationError is displayed when errors are triggered #42

Closed
andreaf-tbm opened this issue Oct 15, 2014 · 5 comments
Closed

Only msgValidationError is displayed when errors are triggered #42

andreaf-tbm opened this issue Oct 15, 2014 · 5 comments

Comments

@andreaf-tbm
Copy link

Non-default error messages (like msgInvalidFileExtension) aren't displayed in case of specific error (such as an invalid File Extension): it's always displayed only msgValidationError.

To reproduce use following code and select a file with an extension different from the ones specified (png, gif).

$(document).ready(function() {
        $("#test-upload").fileinput({
                'showPreview' : false,
                'allowedFileExtensions' : ['png','gif'],
                'msgInvalidFileExtension' : 'TEST MESSAGE'
        });
});
@kartik-v
Copy link
Owner

The validation error message is currently displayed inside the preview window.

Try with showPreview set to true.

@andreaf-tbm
Copy link
Author

Ok.
Probably documentation should provide this information.

Still... I don't care about preview (since I'm actually uploading zip files) but it'd be good to have those messages instead of a simple "File upload error"... am I missing something? Is there a configuration that can enable this kind of behaviour?

@kartik-v
Copy link
Owner

Will note an enhancement request for the scenario when showPreview is false. You still can edit the preview templates to achieve what you need... but you may want to wait for this update.

@andreaf-tbm
Copy link
Author

Ok... got to try it but I think is a good workaround.
I'll look forward this enhancement! :)

Thanks

@kartik-v
Copy link
Owner

Resolved via upgrade to release v2.6.0. Get the latest code. There is a new property elErrorContainer. You can set it to an identifier like #error-div or .error-class.

Check the last example in advanced section at the demo site for usage details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants