I use parsley validation for my form but it does not work for the select list while it does for the input.
I already try to add the attribute data-parsley-required="true"
but it does not work either. Removing tabindex and the same problem still persists.
Could someone please tell me how should I tackle this?
HTML:
<form method="post" action="callback_handle.php" id="myForm">
<div class="qucik-form">
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="form-group">
<input name="fname" id="nameFooter" value="" type="text" class="form-control" placeholder="Name *" tabindex="11" required>
<span class="error" id="er_nameFooter"></span> </div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="form-group">
<input name="femail" id="emailFooter" value="" type="email" class="form-control" placeholder="Email *" tabindex="12" required>
<span class="error" id="er_emailFooter"></span> </div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="form-group">
<input name="fphone" id="phoneFooter" type="text" class="form-control" placeholder="Phone *" tabindex="14" required>
<span class="error" id="er_phoneFooter"></span> </div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="form-group">
<input name="city" id="city" type="text" class="form-control" placeholder="City">
<span class="error" id="er_skypeFooter"></span> </div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<div class="form-group">
<select name="fservice" id="serviceFooter" class="form-control" required>
<option value="Select Interests">Select Interests *</option>
<option value="Website Design">Website Design</option>
<option value="Website ReDesign">Website ReDesign</option>
<option value="Website Development">Website Development ( Dynamic )</option>
<option value="E-Commerce Development">E-Commerce Development</option>
<option value="Search Engine Optimization">Search Engine Optimization</option>
<option value="Social Media Optimization">Social Media Optimization</option>
<option value="Pay Per Click">Pay Per Click</option>
<option value="Logo Designing">Logo Designing</option>
<option value="Complete Digital Marketing">Complete Digital Marketing</option>
<option value="Others">Others</option>
</select>
<span class="error" id="er_serviceFooter"></span> </div>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<button type="submit" name="callback" class="link btn btn-3 btn-3e">Send message<i class="fa fa-arrow-right"> </i></button>
</div>
</div>
</form>
JS:
<script src="jquery.js"></script>
<script src="parsley.min.js"></script>
<script>
$(document).ready(function() {
$("#myForm").parsley();
});
</script>
Your "Select Interests *" option should not have a value
.