jQuery Validate: make field only required if option is selected [duplicate]
问题 This question already has an answer here : jQuery Validate - Get value from select and based on the value make text input required field (1 answer) Closed 5 years ago . I use the jQuery Validate plugin and would like to make a select field only required if another select field has a selected option. Here comes my code: HTML <form id="my-form"> <input type="text" id="myInput" name="myInput"> <select id="mySelect" name="mySelect"> <option value="">Please select</option> <option value="1">Option