html - 如何根据需要制作一个ui-select字段?

标签 html angularjs

我想在我的表单中将以下字段(设置)设置为必填字段。我该怎么做?

<div class="form-group">
    <label class="col-xs-5 control-label"> Settings*</label>

    <div class="col-xs-7">
        <ui-select multiple tagging="adPreferredEmailDomainPatternTransform" id="emailDomainPatternListInput"
                   tagging-tokens="SPACE|," theme="bootstrap"
                   ng-disabled="settings.enableAuthentication == 'false'"
                   ng-model="settings.emailDomainPatternList">
            <ui-select-match>{{$item.displayFormat}}</ui-select-match>
            <ui-select-choices repeat="item in emailDomainPatterns">
                {{item.displayFormat}}
            </ui-select-choices>
        </ui-select>
    </div>
</div>

最佳答案

没有一个答案真的对我有用。我使用与 ui-select 相同的 ng-model 的简单隐藏输入解决了这个问题,并在表单中对其进行了验证。

<input type="hidden" name="email_domain_pattern" ng-model="settings.emailDomainPatternList" required/>

关于html - 如何根据需要制作一个ui-select字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29141730/

相关文章:

javascript - 指令 Angular 中的指令

javascript - Href 在 Angularjs 中覆盖父 ng-click

javascript - 编辑接触 Angular 时用值填充输入框

jquery - 为什么我在 CSS 中的样式不起作用,因为我在 HTML 文件和 CSS 文件中给出了适当的类名?

php - 表单 2 按钮 + javascript 问题

javascript - 使用 AngularJS 创建一个具有自己的键和值的 json 对象

javascript - AngularJS 选择带有 id 和数组索引的选项

javascript - 带有 javascript 文件的 html 图表

html - CSS 变换比例忽略 z-index 和渐变

使用 html() 后 JQuery 重新绑定(bind)