Home » Jquery » javascript – bootstrap validator – validate with both required and custom validation-Exceptionshub

javascript – bootstrap validator – validate with both required and custom validation-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:
<form class="needs-validation" id="barterform" novalidate action="/account/addnewbarter" method="post">
    <div class="col col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
        <div class="form-group label-floating">
            <label class="control-label">Keywords</label>
            <input class="form-control" id="barterkeywords" name='barterkeywords' placeholder="" maxlength="64" type="text"  value='' required>
            <div class="invalid-feedback">Please Enter Keywords.</div>
        </div>
    </div>
</form>

on submitting along with required validation I want to check how many commas is there in that string if more than one I want to display a message like – plz retain only 1 keyword along with required validation.

How to&Answer: