2👍
✅
First, please include the relevant code in your question in the future. The Code Sandbox is great, very helpful, but on Stack Overflow, the goal is to be able to find answers within the site (not needing to leave it to view parts of the question or answer).
You don’t need to use required_if
. Instead, use the object form of v-validate
like so:
<b-input
type="textarea"
v-model="item.detail"
v-validate="{'required':(item.issue_category == 'Other (Enter Detail)')}"
name="detail">
</b-input>
For your other problem, it’s essentially the same except you also forgot to give the select a name
which is required. Also don’t mix HTML5 required
attributes in there, I don’t think it helps:
<b-select
v-model="item.issue"
name="Issue"
v-validate="{'required':(item.issue_category != 'Other (Enter Detail)')}" >
That’s it! See a working example here.
Source:stackexchange.com