<%@ page language="PL/SQL"   %>
createProcedure menuSubmitProc(CorsoSelezionato VarChar2) is
begin

htp.print(
'<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">

function updateSecondSelectSubmit2(nomeCorso) {  

  document.myForm.submit();

}

function updateSecondSelectSubmit(nomeCorso) {  

  navigate("menuSubmit" + nomeCorso + ".html");

}

function selectedValue(select) {
  return(select.options[select.selectedIndex].value);
}

</SCRIPT>
</HEAD>

<BODY onLoad="init();">
<H1>Studenti - Esami - Voti -'
);

htp.print(CorsoSelezionato);
htp.print(
'</H1>
<FORM NAME="myForm" ACTION = "convalidaVoto" METHOD="GET">
Esame: &nbsp;
<SELECT NAME="first" ID="idfirst" onChange="updateSecondSelectSubmit(selectedValue(this));">
  <OPTION VALUE="">'
);

for NomeCorso in (select distinct Corso from Esami)
  loop
    htp.print('<OPTION VALUE="' || NomeCorso || '"');
    if NomeCorso = CorsoSelezionato then htp.print('SELECTED'); end if;
    htp.print('>' || NomeCorso);
end loop;

htp.print(
'</SELECT> 
<P>


<P>
<INPUT TYPE="SUBMIT" NAME="Finito" VALUE="Convalida"> 
</FORM>

<BR>


</BODY>

</HTML>'
);

end menuSubmitProc;





