当我在更改时使用 select 时遇到问题 - 我的变量丢失了......在标题中是:
function reassignPrescreen(prescreen, closer) {
var prescreen = $('input[name=prescreen]');
var closer = $('input[name=closer]');
var data = 'prescreenid=' + prescreen.val() + '&closer=' + closer.val();
alert(data);
$.ajax({
type: "GET",
url: "reassign-prescreen.php",
data: data,
success: function (html) {
alert(html);
}
});
}
而且我的身体有多种形式:
<form action="reassign-prescreen.php" class="psreassign">
<input type="hidden" name="prescreen" value="1">
<SELECT class="chzn-select medium-select select" name="closer" onchange='reassignPrescreen()' data-placeholder="Choose a Closer">
<OPTION VALUE=""></OPTION>
<OPTION VALUE="59785">Ron </OPTION>
<OPTION VALUE="59786">Paul </OPTION>
<OPTION VALUE="74236">Jack </OPTION>
</SELECT>
</form>
<form action="reassign-prescreen.php" class="psreassign">
<input type="hidden" name="prescreen" value="2">
<SELECT class="chzn-select medium-select select" name="closer" onchange='reassignPrescreen()' data-placeholder="Choose a Closer">
<OPTION VALUE=""></OPTION>
<OPTION VALUE="59785">Ron </OPTION>
<OPTION VALUE="59786">Paul </OPTION>
<OPTION VALUE="74236">Jack </OPTION>
</SELECT>
</form>
....ETC...
现在我总是将 prescreen 设置为 1 并且更接近 UNDEFINED 值??