Add values in an array with javascript for update

Asked

Viewed 54 times

0

I need to do a user editing in PHP + javascript, but as I am layman in javascript I do not know how to build the function javascipt since I can have different values within 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 javascript function to receive 1 or more imput parameters

1 answer

0

You can use the input date 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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.