0

I am just learning vue.js.

I have an input, where I want to have already filled field value="{{ current_user.rbe.main_contact_person }}". The user should be able to edit the value. I am trying to send the data with v-model. It only works if an user edits something, but if not it will send nothing.

How could I send the value to database even if it is not edited?

I am using jinja2 and that's why I am using curly bracketsvalue="{{ current_user.rbe.main_contact_person }}".

             <input 
                class="fieldInput"
                placeholder= "{{ current_user.rbe.main_contact_person }}"
                value="{{ current_user.rbe.main_contact_person }}"
                v-model="newContract.name"
              >
Nitsa
  • 53
  • 8
  • At what exact moment do you wish to send a value to DB? Some event or something else? – Anatoly Dec 04 '20 at 17:22
  • @anatoly I have a submit button in the end and it sends also other data. I am using `new FormData` and appending the properties. – Nitsa Dec 04 '20 at 17:25

1 Answers1

1

you don't need the value. simply give the value of {{ current_user.rbe.main_contact_person }} to newContract.name.

Dario
  • 364
  • 2
  • 9