M
M
Max99992020-08-27 16:42:56
Vue.js
Max9999, 2020-08-27 16:42:56

How to change the data before submitting the form?

Good afternoon.
I'm making a button for payment from Yandex money. https://yandex.ru/dev/money/doc/payment-buttons/re... The
question was how to generate a transaction id. I want to request an id on the server before submitting the form and then send it ... v-on:submit.prevent intercepts .. I'll get the id. How to send next?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max9999, 2020-08-28
@Max9999

Decided like this:

<button v-on:click.prevent="submitHandler" >Отправить</button>

  methods: {
    submitHandler(event){
      this.id= '34534555'
      this.$nextTick(() => {
        this.$refs.form.submit()
      })
    }
  },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question