无法从bootstrap模式发布

时间:2015-04-30 05:12:02

标签: node.js post bootstrap-modal html-form-post

在我的应用程序的标题中,我有一个链接,点击它打开引导程序弹出模式。当我在文本框中插入数据并单击“提交”时,不会执行任何操作。请指教。感谢。

这是我的模式的html:

<!-- Modal -->
   <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
   <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h4 class="modal-title">Modal title</h4>
    </div>
     <form action="addCard" method="post" id="addcard" class="form-horizontal" role="form">
     <div class="modal-body" style="height: 140px;">
       <div class="form-group" style="height: 30px;">
            <label for="title" class="col-md-3 control-label">Title</label>
            <div class="col-md-9">
               <input type="text" class="form-control" name="title" placeholder="Enter Card title here...">
            </div>
        </div>
         <div class="form-group" style="height: 30px;">
            <label for="title" class="col-md-3 control-label">Description</label>
            <div class="col-md-9">
               <input type="text" class="form-control" name="desc" placeholder="Enter Card description here...">
            </div>
        </div>
        <div class="form-group">
            <label for="priority" class="col-md-3 control-label">Priority</label>
            <div class="col-md-9">
               <select name="priority" class="form-control">
                <option value="critical">Critical</option>
                <option value="high">High</option>
                <option value="normal">Normal</option>
                <option value="low">Low</option>
                </select>
             </div>
        </div>
    </div>
    <div class="modal-footer">
       <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" type="submit">Submit</button>
      </div>
       </form>
   </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->

我的app.js文件中有这一行:

app.post('/addCard', routes.addCard);

Index.js:

 exports.addCard = function (req,res)
  {
 res.render('index'); 
  }

0 个答案:

没有答案