当表单中的选择选项通过(W3)时,如果未选择单选按钮(请选择单选),如何弹出警报消息。 另外,当选择选项被拒绝(W5)时,如何防止显示警报并显示文本区域
var Privileges = jQuery('#one');
var select = this.value;
Privileges.change(function() {
if ($(this).val() == 'W5') {
$('.resources').show();
} else
$('.resources').hide();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-group ">
<h5><b>Remark :</b></h5>
{{Form::select('remark', ['W3' => 'Pass', 'W5' => 'Reject'], 'W3', ['class' => 'form-control', 'id' => 'one'])}}
</div>
</div>
<div class="col-md-6"></div>
<div class="col-md-6">
<div class="form-line resources" style="display: none; margin-top: 20px !important" id="two">
<h5><b>Note :</b></h5>
<textarea id="txtArea" name="notep6" class="form-control" rows="5" cols="3"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10"></div>
<div class="col-md-2">
<input type="submit" value="Save" class="btn btn-lg btn-success btn-block" id="submit_tenure" style="cursor:pointer;"> {{ csrf_field() }}
</div>
</div>