Bootstrap表单,如何使用POST [英] Bootstrap form, how to use with POST

查看:229
本文介绍了Bootstrap表单,如何使用POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事一个课程项目,并且有一个网页可以进行搜索:
http: //ada.uprrp.edu/~ehazim/hpcf_proj/basicsearch.html

I am working on a class project and I have a webpage to do search: http://ada.uprrp.edu/~ehazim/hpcf_proj/basicsearch.html

以下是基本的代码:

<html>
<head> <title>Search HPCF Inventory</title>
</head>

<body>
    <h1> Search </h1>

    <form action="results.php" method="POST">
    Choose Search Type: <br />
    <select name="searchtype">
        <option value="ip"> IP Adress </option>
        <option value="ss_name"> Software Services </option>
        <option value="IS"> ISBN </option>
    </select>
    <br />
    Enter Search Term:<br />
    <input name="searchterm" type="text">
    <br />
    <input type="submit" value="Search">
    </form>

</body>
</html>

现在,我想使用引导程序3使其非常漂亮。我的网页,但说实话,我不明白引导的形式(我是新的网页),主要是如何说它是通过邮政和如何把变量名称。我一直在寻找这样的网站: http://bootsnipp.com/forms?version=3

Now, I want to make it "pretty" using bootstrap 3. I want exactly what I have in my webpage but to be honest, I don't understand the forms of bootstrap (I am new with webpages), mainly how to say that it is by POST and how to put the variable names. I have been looking for this in websites like this: http://bootsnipp.com/forms?version=3

这看起来很酷,但我不明白如何编辑它...
有人可以分享必要的代码以获得我拥有的确切东西我的网页使用bootstrap?

Which looks really cool, but I don't understand how to edit it... Can someone share the necessary code to have the exact thing that I have in my webpage using bootstrap?

谢谢。

推荐答案

a href =http://getbootstrap.com/css/#forms> http://getbootstrap.com/css/#forms

Read through and follow the example at http://getbootstrap.com/css/#forms

所以,最终会成为

So, would end up being

<form action="results.php" method="POST" role="form" class="form-horizontal">
  <div class="form-group">
    <label for="searchterm" class="col-sm-2 control-label">Choose Search Type</label>
    <select name="searchtype" class="form-control">
      <option value="ip"> IP Adress </option>
      <option value="ss_name"> Software Services </option>
      <option value="IS"> ISBN </option>
    </select>
  </div>
  <div class="form-group">
    <label for="searchterm" class="col-sm-2 control-label">Choose Search Term</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="searchterm" name="searchterm">
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">Search</button>
    </div>
  </div>
</form>

这篇关于Bootstrap表单,如何使用POST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆