This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


My form:

{{ form_ajax('onUpdate') }}
    <input type="text" name="first_name" value="{{ profile.first_name }}">
    <input type="text" name="last_name" value="{{ profile.last_name }}">


    <button type="submit" id="update-data" class="btn btn-success">Update</button>
{{ form_close() }}

My component:

public function onUpdate()
    $data = post();

    $rules = ['first_name' => 'required|between:2,255', 
              'last_name' => 'required|between:2,255'

    $validation = Validator::make($data, $rules);
    if ($validation->fails()) {
        throw new ValidationException($validation);



Now if a field is not properly filled in, I get a warning message and the field gets the focus wich is the expected behaviour.
However, I noticed it generates an error in the JS console:

POST 406 (Not Acceptable)
XHR failed loading: POST "".

I have no idea where this error comes from.
Can someone help me ?

Actually it looks like it's a general issue in October.
In the User plugin for instance, if the "Email" field is left empty a warning message pops up as expected, but a "406 (Not Acceptable)" error appears in the JS console.
Should I report it as a bug ?

Last updated


Ok I got it now. It's explained here:
Since I'm throwing an exception that halts execution and informs the user that the request was unacceptable, it's logical to have an error in the JS console.
I didn't see it that way in the first place, but it makes sense now.

1-2 of 2

You cannot edit posts or make replies: the forum has moved to