How to add and remove a required attribute with a Toggle
问题 My users have access to a form. To simplify the task I put a selectable list but if the answer is not in the list, they can add a reason manually The selectable list is required by default but if the user accesses the text field it becomes required and the list is no longer required (and vice versa). HTML: <div class="form-group"> <select name="motif" class="form-control input-lg" required> <option selected="true" disabled="disabled" value="">Select</option> <option value="1">1</option>