这是我想知道的那些日子之一:我疯了吗?如果我单步执行这个简单的 javascript 函数,执行会从第 3 行跳到第 7 行。
function editStudy() {
var studyindex = document.StudyMaint.StudyList.selectedIndex;
var studyabrv = document.StudyMaint.StudyList[index].text; //Line 3
var msg="Edit study "+studyabrv+"?";
// Get the Study record id was selected in the picklist,
// then go to Study edit screen, then
if (confirm(msg)) {
location.href="editStudy.php?action=UPDATE&studyindex="+studyindex+"&studyabrv="+studyabrv;
} //Line 7
}
但我的表格 StudyMaint 被定义:
<body>
<?php showUserLine(); ?>
<form name="StudyMaint" action="Process_StudyMaint.php" method="POST" onsubmit="return false">
<div id="dataentrybox">
<div id="innerbox">
<div align="center">
...
有人看到我在这里做错了吗?