We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<!DOCTYPE html> <html> <head> <title>ms-validate</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <script src="./avalon.js"></script> <script> var vm = avalon.define({ $id: "test", firstname: '', lastname: '', username: '', password: '', list1: ['dog', 'bird', 'cat'], list: [{name: 'dog', value: '1'}, {name: 'bird', value: '2'}, {name: 'cat', value: '3'}], confirm_password: '', email: '', agree: false, topic: ['1', '2'], toggle: false, checkDogAndCat: function () { vm.topic = ['1', '3'] } }) </script> </head> <body ms-controller="test"> <form class="cmxform" ms-validate="@validate"> <fieldset> <legend>验证完整的表单</legend> <p> <label for="agree1">请同意我们的声明</label> <input type="radio" class="checkbox" id="agree1" value="1" name="agree" ms-duplex-string="@agree"> <label for="agree2">不同意</label> <input type="radio" class="checkbox" id="agree2" value="0" name="agree" ms-duplex-string="@agree"> </p> <legend>主题 (至少选择两个)</legend> <label ms-for="el in @list"> <input ms-duplex="@topic" type="checkbox" ms-attr="{id:el.name,value:el.value}" name="topic">{{el.name}} </label> <label for="topic" class="error" style="display:none">至少选择两个</label> <p> <input ms-click="@checkDogAndCat" class="submit" type="button" value="点击勾选dog&cat"> </p> </fieldset> </form> </body> </html>
初始化时topic=['1', '2'] 默认是勾选dog和bird 点击按钮执行方法 topic=['1', '3'] 多选框中cat的选项并未勾选
The text was updated successfully, but these errors were encountered:
2cfa7ac
No branches or pull requests
初始化时topic=['1', '2'] 默认是勾选dog和bird 点击按钮执行方法 topic=['1', '3'] 多选框中cat的选项并未勾选
The text was updated successfully, but these errors were encountered: