<form id="f">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input parsley-type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email" parsley-trigger="keyup">
</div>
</form>
<script>
$(function(){
$('#f').parsley('validate');
});
</script>
Instead of form element I would like to validate content in div element, is it possible?
Parsley just cannot validate the text inside a div / span element. But you could perfectly validate an input not inside a form tag, in your example you could just do $('#exampleInputEmail1').parsley('validate');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With