引导程序引导框在表单文本字段中的消息中显示变量

bootstrap bootbox show variable in message within form text field

本文关键字:消息 显示 变量 字段 文本 表单 引导程序      更新时间:2023-09-26

我需要输出只读表单字段(文本)中的变量:

$(function() {
  return $("#buy_order_btn").click((function(_this) {
    return function() {
      var price;
      price = $("#order_bid_price").val();
      return bootbox.dialog({
        title: "Confirm Buy Order",
        message: "Price: <input type='"text'" readonly='"readonly'" value='"HERE COMES THE PRICE VALUE FROM ABOVE'">"
      });
    };
  })(this));
});

如何做到这一点?

$(function() {
  return $("#buy_order_btn").click((function(_this) {
    return function() {
      var price;
      price = $("#order_bid_price").val();
      return bootbox.dialog({
        title: "Confirm Buy Order",
        message: "Price: <input type='"text'" readonly='"readonly'" value='"" + price + "'">"
      });
    };
  })(this));
});

当字符串中有html时,我会考虑使用',这样它就可以作为普通html文本可读