Add values in an array with javascript to update

0

I need to make a user edit in PHP + javascript, however as I am a layman in javascript I do not know how to build the javascipt function since I can have different values inside the form.

My form was built like this:

<form action="#" v-on:submit.prevent="save(item.id)" method="POST">
    foreach(configurations as config ){
        <label for="{{conf.key}}"> {{ conf.alias }}</label>
        <input v-model="" type="text" id="{{conf.key}}" name="" class="form-control"> 
    }
    <button class="btn btn-default" type="submit">Salvar</button>
</form>

I'm not sure how to do the javascript function to get 1 or more imput parameters

    
asked by anonymous 19.09.2016 / 16:04

1 answer

0

You can use the input data attribute:

<form action="#" v-on:submit.prevent="save(item.id)" method="POST">
foreach(configurations as config ){
    <label for="{{conf.key}}"> {{ conf.alias }}</label>
    <input v-model="" type="text" id="{{conf.key}}" name="" class="form-control" data-param1="parametro1" data-param2="parametro2"> 
}
<button class="btn btn-default" type="submit">Salvar</button>

    
20.09.2016 / 23:02