语义模态表单按钮

时间:2015-06-22 04:01:14

标签: semantic-ui

我正在尝试在模态中创建一个表单。除了点击我提交的'提交'按钮它关闭模态,即使有必要的字段没有填写。是他们的方式保持模态打开?

添加代码:

模态:

<div class="ui standard billboard modal" style="margin-top: -197.5px; display: block !important;">
    <div class="header">Add Billboard Slide</div>
        <div class="content">
            <div class="ui fluid form billboard">
                <div class="required field">
                    <label>Type</label>
                    <input placeholder="" type="text">
                </div>
                <div class="required field">
                    <label>Image</label>
                    <input name="image" placeholder="" type="text">
                </div>
                <div class="field">
                    <label>URL</label>
                    <input name="url" placeholder="URL" type="text">
                </div>
                <div class="required field">
                    <label>Enable/Disable</label>
                    <input placeholder="" type="text">
                </div>
                <div class="actions">
                    <div class="ui red deny clear button">
                        Cancel
                    </div>
                    <div class="ui positive submit button">
                        Add
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

模态显示:

$('.billboard.modal')
    .modal('attach events', '.billboard.button', 'show')
    .modal('setting', 'closable', false)
;

1 个答案:

答案 0 :(得分:1)

我几天前回答了这个问题:https://stackoverflow.com/a/30895385/2053038

基本思路是在模态的onApprove方法上返回$f = fopen("data/title.txt", "r"); $titleA = fgets($f); 以防止它关闭。然后,您可以在表单准备就绪时调用hide函数。