Defining a `required` field in Bootstrap

后端 未结 7 618
[愿得一人]
[愿得一人] 2020-12-05 03:43

How do I define text field as required (with red border) in Twitter Bootstrap 3?

required=\"required\" doesn\'t work...



        
相关标签:
7条回答
  • 2020-12-05 04:37

    Form validation can be enabled in markup via the data-api or via JavaScript. Automatically enable form validation by adding data-toggle="validator" to your form element.

    <form role="form" data-toggle="validator">
       ...
    </form>
    

    Or activate validation via JavaScript:

    $('#myForm').validator()
    

    and you need to use required flag in input field

    For more details Click Here

    0 讨论(0)
提交回复
热议问题