Это один из тех дней, когда я удивляюсь: я теряю рассудок? Если я пошагово этой простой яваскрипта функции, выполнение скачет из линии 3 в линию 7.Почему JavaScript пропускает мою функцию?
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">
...
Видит кто-то, что я здесь делаю неправильно ?
Где вы звоните в эту функцию? – j08691
Что такое линия 3 и строка 7? – Blender
Есть четыре строки пустоты/комментарии между ними? – Bergi