I have multiple select option with custom naming and i wish to push those custom names to back-end but it doesn't get the name.
Code
sample
<select @change="zoneChange('city', $event)"></select>
<select @change="zoneChange('area', $event)"></select>
<select @change="zoneChange('link', $event)"></select>
What I want to get in backend is like:
array:1 [
"city" => 4
]
or
array:1 [
"area" => 1
]
array:1 [
"link" => 5
]
so that way i can filter my database result based on input name city, area, link, etc.
and find related data to those ids 4, 1, 5....
Currently what i get is:
array:1 [
"val" => 4
]
I need that
val
changes to my custom names.
Script
zoneChange(val, e) {
// val = city, area, link, etc.
// e = 4, 1, 5, etc.
console.log(val, e)
axios.post('/api/admin/maps/valChanger', {val: e})
.then(res => {
//.....
})
.catch(error => {
//.....
});
},
Any idea?