Validate input text in bootstrap modal

前端 未结 4 899
闹比i
闹比i 2021-01-05 17:09

I want to validate a form in a bootstrap modal without using any framework. It\'s actually a simple modal with only an input text and two buttons \"Close\" and \"Send\". Th

4条回答
  •  执笔经年
    2021-01-05 17:46

    You need to change the CSS classes of the input parent element div.form-group, not the input itself:

    The HTML after the submit button click should look like this:

    To achieve this, alter your JavaScript code to this:

    
    

提交回复
热议问题