Oleg Belousov
Oleg Belousov

Reputation: 10121

Allow the file input to be optional with bluimp plugin

This question is partially addressed here.

Only I am using the Angular version of the plugin, and I would like to allow my user to use the form that the bluimp plugin is applied on even without a file.

I tried setting 'disableValidation' option to true, but it didn't help.

I thought to define a $scope variable once the 'fileuploadchange' event triggers at least one, and if this variable remain undefined, use another submit handler on the click or submit event. But there must be a cleaner way than that.

A plunk to emphasize to problem: http://plnkr.co/edit/J1JDYO?p=preview

Upvotes: 3

Views: 255

Answers (1)

Max
Max

Reputation: 156

Oleg, try to change button type to "submit"

<button type="submit" class="btn btn-primary start" data-ng-click="submit()">
<span>Submit text field without file</span>
</button>

Upvotes: 1

Related Questions