Simple forms a non-null authentication method in the framework of SemanticUI

I do not know whether to take effect in other UI frameworks or no UI framework, div is not empty because of this verification information is generated using the syntax SemanticUI framework, we do uncertain, pending verification ... after
first introducing jquery.js file
then look as follows:

<script>
// 表单非空验证
  $('.ui.form').form({
    fields : {
      username : {
        identifier: 'username',
        rules: [{
          type : 'empty',
          prompt: '请输入用户名'
        }]
      },
      password : {
        identifier: 'password',
        rules: [{
          type : 'empty',
          prompt: '请输入密码'
        }]
      }
    }
  });
  
  
  
</script>

For example, in the login screen do form validation, then add a div at the login button (the div still in the same form), the format is as follows:

<div class="ui error mini message"></div>

Then verify the effect of non-null FIG:
Here Insert Picture Descriptionlook interface code:
Here Insert Picture Descriptionpreviously claimed <div class="ui error mini message"></div>which has been filled with an unordered list ul.

Published 14 original articles · won praise 15 · views 509

Guess you like

Origin blog.csdn.net/CodingNO1/article/details/104510932