Hi everyone,
I have a problem with the following tcl code, which I am working on for a school project: it builds a form which should pass the entries to another script, but when the user submits the values it just reloads the page, in spite of the ad_returnredirect instruction (which links to an existing file). On a further inspection, I noticed that no lines from the on_submit and after_submit blocks are executed.
What I really can't understand is that everything works fine if I take out the parameter declaration from ad_page_contract and replace it with a fixed value for istruttori_id...
ad_page_contract {
Inserimento Orario Settimanale
} {
istruttori_id:integer
}
set caption [db_string query "select a.nome || ' ' || a.cognome from scg_istruttori a where a.istruttori_id = :istruttori_id"]
set prev_page "Orario di $caption"
set page_title "Pianifica l'orario settimanale"
set context [list [list index {Scuola Guida}] [list istruttori-list {Lista Istruttori}] [list orari-list?istruttori_id=$istruttori_id $prev_page] $page_title]
ad_form -name orari \
-has_edit 1 \
-form {
{max_dow:integer(select)
{options {{"Lunedì - Sabato" "6"} {"Lunedì - Venerdì" "5"} } }
{label "Giorni"}
{html {size 1}}
}
{ora1:text
{label "Ora inizio mattino"}
{html {size 7} }
}
{ora2:text
{label "Ora fine mattino"}
{html {size 7} }
}
{ora3:text
{label "Ora inizio pomeriggio"}
{html {size 7} }
}
{ora4:text
{label "Ora fine pomeriggio"}
{html {size 7} }
}
} -on_submit {
#instructions
} -after_submit {
ad_returnredirect "orari-inse-q?max_dow=$max_dow&ora1=$ora1&ora2=$ora2&ora3=$ora3&ora4=$ora4"
ad_script_abort
}