How to make textbox required if a certain value is selected in dropdown box

207 views
0

How to make textbox required if a certain value is selected in drop-down box using Jquery?

 

htmlAdmin2609 Changed status to publish October 2, 2021
Add a Comment

Warning: Invalid argument supplied for foreach() in /home/u222619860/domains/htmlcss3tutorials.com/public_html/wp-content/plugins/anspress-question-answer/includes/reputation.php on line 320
0

The HTML Code

<div class=”col-md-5″>

Select Discipline

<select id=”groups” class=”form-control” name=”discipline” required=””>
<option disabled=”disabled” selected=”selected” value=”0″>Select</option>
<option value=”CSE”>CSE</option>
<option value=”HCD”>HCD</option>
<option value=”ECE”>ECE</option>
<option value=”CB”>CB</option>
<option value=”MATH”>MATH</option>
</select>

</div>
<div class=”col-md-6″>

Select Degree

<select id=”degreeTypes” class=”form-control” name=”degreeTypes”>
<option value=”BSc-Computer-Science”>BSc (Computer Science)</option>
<option value=”BSc-In-any”>BSc</option>
<option value=”BTech-BE”>BTech/BE(CSE/IT/ECE/EE)</option>
<option value=”BPharma”>BPharma</option>
<option value=”MBBS”>MBBS</option>
</select>

</div>

Jquery Code

htmlAdmin2609 Changed status to publish October 2, 2021
Add a Comment
Write your answer.
close