0

So I have a form with some vue.js data like

<div class="form-group">
     <label class="form-label" for="field_description">Ontology Version</label>
     <input type="text" name="ontology-version" class="form-control" disabled :value="ontology">
</div>

When I submit the form by clicking the submit button, there's no data for the ontology-version in the POST request.

I have a submit button like this <button type="submit" class="btn btn-primary ml-auto">Save</button>

Also, When I inspect the element on chrome, I see that no value is set

inspect element chrome

5
  • How are you submitting the form, what does the rendered HTML look like when you do, and what is being sent? Commented Mar 8, 2019 at 21:20
  • hello, @robinsax I've edited the question to add more info. Commented Mar 8, 2019 at 21:23
  • You are leaving out code and logic in your question that will help someone find you an answer. Show us what your vue code looks like, show us the rest of your markup because youre just showing one div element. Tip: Avoid using images. and by the way, you are sending a request to 10.10.10.10... does that address even exist? Look in network tab in dev tools and see what the request/response looked like Commented Mar 8, 2019 at 21:36
  • Possible duplicate of Disabled form inputs do not appear in the request Commented Mar 8, 2019 at 22:21
  • 2
    The ontology-version input is disabled, so it's not included in the form data. Use readonly instead of disabled. Commented Mar 8, 2019 at 22:21

2 Answers 2

2

As said in comments and previous answer if you submit disabled input field .It wont be sent when request is made so pass it as readonly if you are intend to send this value.

<div class="form-group">
     <label class="form-label" for="field_description">Ontology Version</label>
     <input type="text" name="ontology-version" class="form-control" readonly :value="ontology">
</div>
Sign up to request clarification or add additional context in comments.

Comments

0

Disabled input fields are not sent when the request is made.

This is by design, so you can filter fields out.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.