NicolasCARPi / jquery_jeditable

jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
https://jeditable.elabftw.net
MIT License
1.74k stars 458 forks source link

Can't Change id or name. submission is null #184

Closed redbonzai closed 4 years ago

redbonzai commented 6 years ago

Description

when I change the id, and name to a specific value, in my case : name: 'category_name', and id: 'category_name' it isn't carried in the request. The request object still has the name: 'value', and id: 'id'

how to reproduce

$('.edit-category-name').editable('/category/update/2', {
        type: 'text',
        cancel: 'Cancel',
        submit: 'Save',
        id: 'id',
        name:'category_name',
        class: 'form-control',
        cancelcssclass: 'btn btn-danger',
        submitcssclass: 'btn btn-success', ... etc 

(add a jsfiddle/codepen example)

expected result

I expect the id, and the name to be changed and to be able to receive the name, id in the request object on the server side.

actual result

$request->get('category_name') = null
and $request->get('id') = null

Environment

laravel environment Browser: Chrome OS: OS X

NicolasCARPi commented 6 years ago

Could it be because you are accessing the "get" from the request object instead of the "post"?

redbonzai commented 6 years ago

The ->get() function is a function inherent within the Laravel API that allows us to select elements from the POST array.
The problem is that these variables aren't being put within the post array. They aren't being received on the server side.

NicolasCARPi commented 6 years ago

Can you check with the browser (F12 > Network) what exactly is being sent? Because this is not reproducible.