当用户在标识为=IF(AND(C53=D53, C53="STI"), "No OR, Straight to IM",
IF(COUNTBLANK(C53:D53)=2, "No Date Input",
IF(AND(C53 = "Still Pending", D53>=DATE(2013, 1, 1)), "Error, Check Again",
IF(AND(C53>=DATE(2013, 1, 1), D53 = "Still Pending"), TODAY()-C53,
IF(COUNT(C53:D53)=2, D53-C53, "not covered")))))
的选择框中进行选择时:
some_select_box
类的所有表单字段,并更改其所有值以匹配所选值。我在代码中遗漏了一些明显的东西:
hidden_search_box
回答:jsfiddle
答案 0 :(得分:2)
你的js小提琴中的问题是,你还没有添加jQuery库,所以你应该在你的控制台中遇到Uncaught ReferenceError: $ is not defined
这样的错误。
要将jQuery添加到小提琴中,请在javascript面板中单击右上角的图标,然后在库下拉列表中选择jQuery。
答案 1 :(得分:1)
您的代码中有一个拼写错误,在$(".hidden_search_box")
中,缺少双引号。
$(function() {
$(document).on('change', '#some_select_box', function() {
var selected_value = this.value;
$(".hidden_search_box").each(function() {
debugger;
this.value = selected_value;
});
});
})
答案 2 :(得分:1)
试试这个
$(document).on('change', '#some_select_box', function () {
$(".hidden_search_box").val(this.val());
$(".hidden_search_box option[value='"+this.val()+"']").attr('selected','selected');
});