我有一个表单,我可以从中触发 Bootbox 对话框弹出窗口,如下所示:
$(function() {
return $("#buy_order_btn").click(function() {
return bootbox.dialog({
title: "Confirm Buy Order",
message: " // here should come the product name from the initial form"
});
});
});
问题:如何在 bootbox 的消息部分中显示初始订单表单中的值?
我在想类似的东西
var product = $("input[id='product']").val()
但我不确定。请指教
编辑:
初始形式如下所示:
<form>
<input type=text id=product>
</form>