情况:
我们打开第一个 fancybox,用户在其中填写日期、时间、位置等基本数据。
在那篇文章之后,我们打开第二个 fancybox 窗口,允许用户填写一些详细信息。例如金额、群组名称、电子邮件等。当金额高于 15 和 30(当位置 = X 时)、30 和 60(当位置 = Y 时)时,我们会自动创建其他时间。
但是如果该金额高于一天允许的最大值。它需要打开第三个幻想框,允许用户为其他人填写额外的日期。
问题:
问题是当第二个 fancybox 的 amount 字段高于某个数字时,如何让 fancybox 打开。该特定数字取决于首页上的字段。
代码:
function closeFancyGroepAndIndi() {
$.fancybox.close();
// this would always open that page
// $.fancybox({
// 'type': 'ajax',
// 'ajax': { cache: false },
// 'href': ResolveUrl('~/Groep/CreateDouble')
// });
// reloads the main tables. This should only be the case when the amount is not higher.
$("#reservationList").load(ResolveUrl('~/Reservation/reservationList'));
if ($("#indexGroep") && $("#indexIndividual")) {
var id = $("#reservationId").val();
$("#indexGroep").load(ResolveUrl('~/Reservation/groepList'), { reservationId: id });
$("#indexIndividual").load(ResolveUrl('~/Reservation/individualList'), { reservationId: id });
}
到目前为止的想法:
我想检查第二页中的值(它是 javascript),但随后我必须将第三个 fancybox 中的值赋予隐藏字段。 值的检查将会发生。 leftOverAmount = $('#AmountHidden').val(); maxAmount = $('maxAmountHidden').val();
那么我如何在他的 javascript 中获取我的第一页在第二页中的位置?
最佳答案
在文本框的模糊事件上调用函数,例如
现在,只要用户输入任何值并切换到某个不同的字段,就会调用 javascript 函数。在该函数中,检查文本框的值,如果它大于所需值,则触发 js 函数打开新的弹出窗口。
标记此答案是否适合您
干杯!
关于javascript - 当字段大于 15 时,在 [HTTP POST] 之后打开 fancybox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11290372/