-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Cannot save page with media upload if validate.required: true is set #887
Comments
Replicated and got to http://stackoverflow.com/a/28340579 but I can't find the source of the problem, because there is no hidden field marked as required. |
Actually I see the issue, the
@w00fz is this a known issue already? |
You looking at the wrong field, that one highlighted has no name so it's not really part of the form. |
Yes the problem looks like the browser shows the error because that field (which is hidden) is required, and from my understanding it tries to say "Fill this field" but since it's hidden, it raises that |
So maybe we should remove required="required" from the hidden file field and do a js validation? |
In the documentation , for the Have not yet traced through all of the JavaScript and client side... After the successful AJAX can we set the value of the hidden field (e.g., |
Yes this has completely changed, see #748 for a better understanding. |
Using the required attribute for the file input field is not possible. When using dropzone the standard file field is hidden and can't be focused to display the client side error message: client side validation fails. But removing the dropzone plugin from the form plugin just solves the first issue. The second issue appears when gravs deeply build in ajax-upload functionality kicks in to clear the standard file field selection so that it does not upload any data to the server: server side validation fails. The form plugin should have a flag to turn on dropzone + ajax-upload. The standard html file form field which would work with the build in validation of the browser should be default for the form plugin |
So we can't make "file" type as required? |
(Bug still here in Grav 1.4.3) |
Still encounter this problem. Any updates on this? |
I am trying to create a blueprint which includes something like the following:
However, if I have the
validate.required: true
component when I got to click the save button in the admin panel, nothing will happen. I only get a javascript error:If I remove:
Then the page will save, file uploads, etc.
I have tried changing and removing the various other parameters, but it seems to be that when I make it a required field I am unable to save.
What might be interfering and preventing me from making this work that I can set within
grav
? I believe this error is because it is failing to perform the client-side validation (?)I also noted if I add:
The name value (in this case
event-image
) does not appear anywhere in the HTML source on the admin page (I also tried with quoting the value forname
)The text was updated successfully, but these errors were encountered: