WordPress database error: [Can't create/write to file '/tmp/#sql-temptable-4db-155b79-41a.MAI' (Errcode: 28 "No space left on device")]SELECT p.* FROM wp_mdb_forum_posts AS p LEFT JOIN wp_mdb_forum_posts AS q ON( q.Id = p.ParentId AND p.Id = q.AcceptedAnswerId ) WHERE p.PostTypeId = 2 AND p.ParentId = 108465 GROUP BY p.Id ORDER BY CASE WHEN q.Id IS NOT NULL THEN 1 ELSE 0 END DESC, p.UpvoteCount DESC, p.CreationDate ASC
Topic: invalidFeedback & Laravel Validation Issue
Problem: If the laravel-validation fails because no value is given in the form-field, everything works perfectly. But if it fails because the name-form-value is too long, the invalid feedback is not displayed.
My Question: What kind of influence do I have on the "invalidFeedback" so that it is displayed when I need it without writing further jQuery code like:
$("#form-name").removeClass("is-invalid");
$("#form-name-section .invalid-feedback").html("");
$("#form-name").addClass("is-invalid");
$("#form-name-section .invalid-feedback").html(errormessage);
Here is my code:
I can validate my incoming data in Laravel and, depending on the error, send various error messages back to the front end.
$data = request()->validate([
'name' => 'bail|required|min:3|max:128',
'email' => 'required|email',
'message' => 'required',
'privacy' => 'accepted'
]);
In response I get an object with the error notifications in vue-axios.
{
name: ["My Error Message"],
email: ["My Error Message"],
message: ["My Error Message"],
privacy: ["My Error Message"]
}
I save this in my prepared vue-error-data-object.
errors: {
name: "",
email: "",
message: "",
privacy: "",
}
And so.
let errors = e.response.data.errors;
this.errors.name = errors.name[0]
this.errors.email = errors.email[0]
this.errors.message = errors.message[0]
this.errors.privacy = errors.privacy[0]
Now I use the mdb-invalidFeedback and simply insert the error message.
<mdb-input
label="Your Name"
v-model="fields.name"
:invalidFeedback="errors.name"
required
/>
Regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: MDB Vue
- MDB Version: 6.7.1
- Device: PC
- Browser: Firefox
- OS: Windows 10
- Provided sample code: No
- Provided link: No