相关疑难解决方法(0)

表单提交前的Bootstrap Modal

我是Modals的新手,我有一个表格,当用户点击提交时,它会显示一个模态确认用户是否想要提交,该模式还包含来自表单字段的用户输入.我搜索了整个互联网,但找不到合适的我的需求.我只看到他们将click事件标记为在链接上打开模态.我有一个输入类型提交.你能举出例子或想法吗?谢谢!这是我的样本表格.

<form role="form" id="formfield" action="inc/Controller/OperatorController.php" method="post"  enctype="multipart/form-data" onsubmit="return validateForm();">
<input type="hidden" name="action" value="add_form" /> 

       <div class="form-group">
         <label>Last Name</label><span class="label label-danger">*required</span>
         <input class="form-control" placeholder="Enter Last Name" name="lastname" id="lastname">
       </div>

        <div class="form-group">
          <label>First Name</label><span class="label label-danger">*required</span>
          <input class="form-control" placeholder="Enter First Name" name="firstname" id="firstname">
       </div>

  <input type="submit" name="btn" value="Submit" id="submitBtn" class="btn btn-default" data-confirm="Are you sure you want to delete?"/>
  <input type="button" name="btn" value="Reset" onclick="window.location='fillup.php'" class="btn btn-default" data-modal-type="confirm"/>
</form>
Run Code Online (Sandbox Code Playgroud)

javascript jquery modal-dialog twitter-bootstrap

34
推荐指数
1
解决办法
10万
查看次数

提交按钮在asp.net mvc中不起作用

我有一个模型:

public class FormCreateModel
{
    public FormModel formInfo { get; set; }
    public FieldModel fieldInfo { get; set; }
    public InstitutionModel selectedInst { get; set; }
    public FormTypeModel selectedFormType { get; set; }
    public CategoryModel categoryInfo { get; set; }
    public List<InstitutionModel> institutions { get; set; }
    public List<FormTypeModel> FormTypes { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

我为这个模型创建了一个强类型视图:

@using (Html.BeginForm()) 
{ 
    <p>
        @Html.LabelFor(lbl =>lbl.selectedInst.Institution_Name, "Institution Name :", new { @class="lblName"})
        @Html.DropDownListFor(drpdown => drpdown.selectedInst.Institution_Name, new SelectList(Model.institutions.Select(inst => inst.Institution_Name)),"-- select Institution--", new { @class …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc razor asp.net-mvc-4

5
推荐指数
1
解决办法
1万
查看次数

Bootstrap表单中的Submit按钮对输入键没有反应

我有以下Bootsrap形式:

<div class="modal-content">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
      <span aria-hidden="true">×,
      </span>
    </button>
    <h4 class="modal-title">Datei speichern
    </h4>
  </div>
  <div class="modal-body">
    <p>Gib einen Dateinamen ein
    </p>
    <div class="form-group">
      <label class="input-label" for="project-bar-input">
      </label>
      <input type="text" class="form-control" id="project-bar-input">
    </div>
  </div>
  <div class="modal-footer">
    <button type="button" class="modal-cancel btn btn-default" data-dismiss="modal">Abbrechen
    </button>
    <button type="submit" class="modal-action btn btn-primary" data-dismiss="modal">Speichern
    </button>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我尝试捕获一个ENTER键事件

$( ".modal-content" ).find( "input#submit" ).click( function() {
    // submit
});
Run Code Online (Sandbox Code Playgroud)

看完之后:

提交按钮不在Bootstrap表单中工作

但它不起作用.为什么?

input submit button twitter-bootstrap bootstrap-modal

3
推荐指数
1
解决办法
1万
查看次数