Html 表单之外的Post值

Html 表单之外的Post值,html,forms,post,Html,Forms,Post,我正在编写一个表单,我希望能够发布表单内部的值,以及获取表单外部的字符串。这是我的密码 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <d

我正在编写一个表单,我希望能够发布表单内部的值,以及获取表单外部的字符串。这是我的密码

<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">&times;</button>
        <h4 class="modal-title" id="myModalLabel">A Honey of a Saison</h4>
      </div>
      <div class="modal-body">
        <div>
        <img class="pull-left" style="padding-right: 5px" src="images\beer pics\A Honey of A Siason.jpg"/>
            <p>
                Name: A Honey of a Saison<br>
                By: Boulder Beer / Wilderness Pub<br>
                Style: Belgian Strong Pale Ale<br>
                ABV: 11.50%<br><br>
                Price: $5.99
            </p>
            <p>
                Description: <br> Pours a hazed bronze color and light white foam and lace.
                Aroma of malty sugar, Belgian yeast, honey sweetness. In the taste, mild herbal bitterness,
                sweet malt notes, honey, as advertised, and booze. There are hints of herb, mint, and pepper.
                Mostly sweet, some alcohol is noticed, but tastes pretty good. Medium bodied, well carbonated,
                loose, smooth feel with a low level of heat. Overall, this was a big sweet saison, as you would
                expect from such a name.
            </p>
        </div>
      </div>
      <div class="modal-footer">
        <form method="post">
            <label for="amount">Amount</label>
            <input type="number" name="amount" min="0" max="12" >
            <button type="submit" class="btn btn-primary">Add to Cart</button>
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </form>
      </div>
    </div>
  </div>
</div> <!-- end of myModal -->

&时代;
甜言蜜语

名称:一种赛森蜂蜜
作者:博尔德啤酒/荒野酒吧
风格:比利时浓淡啤酒
ABV:11.50%

售价:$5.99

描述:
浇铸一种朦胧的青铜色和浅白色泡沫和花边。 麦芽糖、比利时酵母、蜂蜜甜味的香气。在味道上,温和的草药苦味, 甜麦芽味、蜂蜜(如广告所示)和酒。有香草、薄荷和胡椒的味道。 大部分是甜的,有一些酒精,但味道很好。酒体适中,碳酸含量高, 手感松软光滑,热量低。总的来说,这是一个非常甜蜜的赛森,就像你会说的那样 期待从这样一个名字。

数量 添加到购物车 关

我正试图用id=“myModalLabel(在本例中为Saison的蜂蜜)

发布该模式的金额和标题,您唯一现实的选择是:

  • 在表单中移动所需的字段
  • 提交时,使用JavaScript获取所需的值,并将其复制到表单内部的隐藏输入中

我不确定您是否能够,但我相信您必须使用javascript来实现这一点……使用隐藏输入字段:)